Problem with parsing varible
Posted: Fri Feb 13, 2004 9:01 am
I am problems with obtaining a variable form the previous page.
I am being told "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
Here is the code which triggers the action
print "<td><a href = 'search.php?id=$style'><img src='$test' width='128' height='85' alt='Click here to see more info on this shoe'></a></td>";
The code on the second page is
$style = $_GET["$style"];
$sql = "SELECT * FROM tblShoestest where StyleID like $style";
$resultID = mysql_query($sql, $linkID)or die(mysql_error());
Am i asking for the wrong thing? should i be asking for id?
What I want to happen is then the picture is clicked on, the next page goes and does a query to find out more and display
Any help appreciated
I am being told "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
Here is the code which triggers the action
print "<td><a href = 'search.php?id=$style'><img src='$test' width='128' height='85' alt='Click here to see more info on this shoe'></a></td>";
The code on the second page is
$style = $_GET["$style"];
$sql = "SELECT * FROM tblShoestest where StyleID like $style";
$resultID = mysql_query($sql, $linkID)or die(mysql_error());
Am i asking for the wrong thing? should i be asking for id?
What I want to happen is then the picture is clicked on, the next page goes and does a query to find out more and display
Any help appreciated