I am admittedly a noob to PHP and mySQL, Have been running through some tutorials. Whenever I run the following script I get this error message: mysql_query() expects parameter 2 to be resource, boolean given.
Any help would be greatly appreciated.
Any help would be greatly appreciated.
Code:
<?php
$input = $_POST['Rating'];
//connect to database
$link = mysql_connect("localhost", "name", "pword");
$db = mysql_select_db("test", $link);
$query = "SELECT RatingID FROM rating WHERE rating.Rating ='$input'";
$result = mysql_query($query, $db) or die(mysql_error());
$row = mysql_fetch_array($result);
echo "Rating ID - ". $row['RatingID'];
?>
Comment