View Single Post
Old 05-07-2007, 04:25 PM   #1 (permalink)
selina
 
True Techie

Join Date: Feb 2006

Posts: 228

selina

Send a message via ICQ to selina Send a message via Yahoo to selina
Default mysql_query(): supplied argument is not a valid MySQL-Link resource in...

i have a problem for PHP4, maybe you can help me.
i'm getting the error message:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in //path/rsvp.php on line 9

for the code:
<?php
$mysql = mysql_connect("localhost", "userid", "pw", "databse");
/* check connection */
if (!$mysql) {
die ('could not connect: ' . mysql_error());
}
else {
$display_block="name to find is \"" .$_POST["name"]."\"<br />";
$namesearch_sql="SELECT * FROM tbl_guests WHERE guest_name LIKE '".$_POST['name']."%'";
$namesearch_res=mysql_query($mysql, $namesearch_sql) or die(mysql_error($mysql));
if (mysql_num_rows($namesearch_res) < 1) {
$display_block .= "no name";
}
else {
$display_block="name found.";
}
/* close connection */
mysql_close($mysql);
}
?>
selina is offline