dadamssg Posted January 25, 2009 Share Posted January 25, 2009 if my url is whatever.com/blahblah.php?id=45 how should i write the get function to get that id in a variable...below isn't working $postid = $_GET['id']; Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/ Share on other sites More sharing options...
gevans Posted January 25, 2009 Share Posted January 25, 2009 well, that's exactly how u do it Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/#findComment-746021 Share on other sites More sharing options...
dadamssg Posted January 25, 2009 Author Share Posted January 25, 2009 well poop...i get a Parse error: syntax error, unexpected T_VARIABLE on that line Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/#findComment-746024 Share on other sites More sharing options...
gevans Posted January 25, 2009 Share Posted January 25, 2009 can you show em the few lines of code above and bellow it? Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/#findComment-746027 Share on other sites More sharing options...
RichardRotterdam Posted January 25, 2009 Share Posted January 25, 2009 You probably forgot a semicolon before the line you posted. can you show the code before that? Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/#findComment-746029 Share on other sites More sharing options...
dadamssg Posted January 25, 2009 Author Share Posted January 25, 2009 sure can <?php /*Get post id number and display info*/ include("caneck.inc") $postid = $_GET["id"]; $cxn = mysqli_connect($host,$user,$passwd,$dbname) or die ("Couldn't connect"); $quer = "SELECT * FROM test WHERE eventid = $postid"; $rsult = mysqli_query($cxn,$quer) or die ("Couldn't execute"); $row = mysqli_fetch_assoc($rsult); ?> Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/#findComment-746030 Share on other sites More sharing options...
gevans Posted January 25, 2009 Share Posted January 25, 2009 <?php /*Get post id number and display info*/ include("caneck.inc"); $postid = $_GET["id"]; $cxn = mysqli_connect($host,$user,$passwd,$dbname) or die ("Couldn't connect"); $quer = "SELECT * FROM test WHERE eventid = $postid"; $rsult = mysqli_query($cxn,$quer) or die ("Couldn't execute"); $row = mysqli_fetch_assoc($rsult); ?> forgot your semicolon Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/#findComment-746031 Share on other sites More sharing options...
dadamssg Posted January 25, 2009 Author Share Posted January 25, 2009 ahh you were right...forget ANOTHER semicolon on my include...thanks! its working Link to comment https://forums.phpfreaks.com/topic/142385-solved-help-with-_get/#findComment-746032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.