understanding db connection error

wxdqz

New Member
Our company recently switched over to php4 and I have started getting the following error:


Warning: Supplied argument is not a valid MySQL-Link resource in C:\Inetpub\wwwroot\GulfStreamDealers\admin\edit.php3 on line 23

Here is the non- working code

$connection = mysql_connect("localhost","root","") or die("Couldn't make connection.");
$db = mysql_select_db("AAAAA", $connection) or die("Couldn't select database.");

//clear out any old sessions
$sql = "SELECT * FROM tblUsers where uid='$uid'";
$sql_results = mysql_query($sql, $db);

However if I change the last line to:

$sql_results = mysql_query($sql);

minus the $db it works fine. Is this a change from php3-php4 because I could not find it in the documentation? Is this the new standard and now all the old code needs to be changed.

thanks for any help.

Ace21
 
Back
Top