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);
}
?>