im trying retrive info from url ( index.php?page= ) and insert it in the code, but i keep geting the error message saying "no rows found" wich i made it do, so what did i do wrong?
here is the code
<?php
// mysql variables
$host = "BLOCKED";
$user = "dbo154983898";
$pass = "Q439a.gw";
$db = "db154983898";
// open connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// Grabs variable from url
$page = $_GET[page];
// Setup mysql connection
$query = "SELECT * FROM 'reviews' WHERE 'id' = '$page' ";
$result = mysql_query($query); // <-- this line
// Then display the result as you wish
// see if any rows were returned
if (mysql_num_rows($result) > 0) {
// yes
// print them one after another
echo "<table cellpadding=10 border=1>";
while($row = mysql_fetch_row($result)) {
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "</tr>";
}
echo "</table>";
}
else {
// no
// print status message
echo "No rows found!";
}
// close connection
mysql_close($connection);
?>