georegjlee Posted March 22, 2007 Share Posted March 22, 2007 I keep getting this error message and I dont understand why. Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\waterways1\admin\help.php on line 30 Anyone got an idea? <html> <head> <title>TEST</title> </head> <body> <?php echo ("FUCK"); //connection to the database $dbhandle = mysql_connect("localhost", "root", "") or die("Couldn't connect to SQL Server on $myServer"); //select a database to work with $selected = mysql_select_db("waterways", $dbhandle) or die("Couldn't open database myDB"); if (isset($_POST['Submit'])) { $query = "INSERT INTO problems (problem_id) VALUES ('05');"; $result = mysql_query($query, $dbhandel); //} print_r($query); } else{ $query = "SELECT * FROM pending_problems"; $result = mysql_query($query, $dbhandle); print ("<h3 style = \"color: blue\"> Problems Table</h3>"); print ("<form id=\"form1\" name=\"form1\" method=\"post\">"); print ("<table border = \"1\" cellpadding = \"3\" cellspacing = \"2\">"); while ($row = mysql_fetch_row($result)) { //print_r ($row); $id = $row[0]; $description = $row[1]; $ww_id = $row[3]; $severity = $row[2]; $name = $row[4]; $table_block .= "<tr><td>$id</td><td>$ww_id</td><td>$description</td><td>$severity</td><td>$name</td><td>Check box to delete</td><td><p><input type=\"checkbox\" name = \"id_array[]\" value = \"$id\"></p></td></tr>"; } mysql_free_result ($result); mysql_close($dbhandle); print ($table_block); print ("</table>"); print ("<input type=\"submit\" name= \"Submit\" value = \"Update Problems\" />"); print ("</form>"); } ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/43858-error-message/ Share on other sites More sharing options...
Orio Posted March 22, 2007 Share Posted March 22, 2007 Typo... This: $result = mysql_query($query, $dbhandel); Should be: $result = mysql_query($query, $dbhandle); Orio. Link to comment https://forums.phpfreaks.com/topic/43858-error-message/#findComment-212940 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.