Check your MySQL Function Arguments
The problem is always simple, once you FIND it! I had two problems here, the first was the mysql_connect() function arquments I was using. The argument for host is the host of the MySQL database, not the remote host trying to connect. The second problem was the PHP code itself. I went to the ZEND website and looked up the mysql_connect() function and used the example code they had in place of the code I got from a instructional book (PHP and MySQL Web Development, 3rd Edition) and BINGO, it worked. Alot of troubleshooting. I thought I should answer my own post as I hate it when people post and then say, "nevermind, I found it". I don't care how stupid I look (comes natural for me), if it saves someone else from burning time, POST IT! Also, I don't know why this fixed it, the function call done in similar fashon. If any knows why, I would like to know.
<?php
/*******************************************
Database query to get poll info
*******************************************/
// get vote from form
$vote=$_REQUEST['vote'];
// log in to database
//if (!$db_conn = mysql_connect('192.168.1.15', 'poll', 'poll')) // old method
//{
// echo 'Could not connect to db<br />';
// exit;
//};
$db_conn = mysql_connect('192.168.1.15', 'poll', 'poll') // new method
or die('Could not connect: ' . mysql_error());
//echo 'Connected successfully';
mysql_select_db('poll') or die('Could not select database');
//@mysql_select_db('poll');
* mysql_connect
|