jarv Posted June 6, 2013 Share Posted June 6, 2013 I am passing the BookID through in the URL but I get teh following error: [06-Jun-2013 16:00:56] PHP Parse error: syntax error, unexpected '=' in /Applications/MAMP/htdocs/mrmen/getmrmen1.php on line 4 my code: <?php $BookID = $_REQUEST['BookID']; echo $BookID; mysql_query="SELECT BookID,BookTitle,BookInfo FROM mrmen WHERE BookID = $BookID"; $cur=(mysql_fetch_row); while($i=$cur) {$BookID=$i[0]; $BookTitle=$i[1]; $BookInfo=$i[2]; } ?> Link to comment https://forums.phpfreaks.com/topic/278846-id-not-being-passed-through-from-querystring/ Share on other sites More sharing options...
Zane Posted June 6, 2013 Share Posted June 6, 2013 mysql_query="SELECT BookID,BookTitle,BookInfo FROM mrmen WHERE BookID = $BookID"; Change to mysql_query("SELECT BookID,BookTitle,BookInfo FROM mrmen WHERE BookID = $BookID"); Also, you need to assign this to a variable if you want to do ANYTHING with it... Link to comment https://forums.phpfreaks.com/topic/278846-id-not-being-passed-through-from-querystring/#findComment-1434454 Share on other sites More sharing options...
jarv Posted June 6, 2013 Author Share Posted June 6, 2013 I have done what you suggested and put the mysql_query in () still getting teh same message Link to comment https://forums.phpfreaks.com/topic/278846-id-not-being-passed-through-from-querystring/#findComment-1434455 Share on other sites More sharing options...
TOA Posted June 6, 2013 Share Posted June 6, 2013 $cur=(mysql_fetch_row); This is line 4...you're calling this function incorrectly. Link to comment https://forums.phpfreaks.com/topic/278846-id-not-being-passed-through-from-querystring/#findComment-1434458 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.