Passing variables via URL to php
Posted by: Darren_S
Posted on: 2006-11-17 14:39:00
Hi,
The following URL worked fine with my old hosting company (PlusNet)
http://www.countybeermakers.org.uk/recipes/recipe.php?table=anniversary&num=1
However I now get the following error after moving site to Dreamhost
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in /servername/recipes/recipe.php on line 84
It's actually this line that's causing the problem
$query = "SELECT * FROM $table WHERE number=$num";
If I hard code the table and record numbers as follows it works fine
$query = "SELECT * FROM anniversary WHERE number=1";
So it's the passing of the variables from the URL to php that's not working
any more.
Any ideas why?
Thanks, Darren