Tjdunklee Posted June 29, 2009 Share Posted June 29, 2009 I'm in the process of creating an admin section for a site which first brings up a list of articles and then has an "edit" link which will pass the id of the article to an edit page so it can fill in the current values. I'm very new to PHP and I'm having trouble getting the link to work. Here is what I am currently using. while($row = mysql_fetch_array($result)) { echo $row['newsTitle']; echo " | <a href='editNews.php?newsID="$row['newsID']"'>edit</a>"; echo "<br />"; } When I try and load the page I get the following error. Parse error: parse error, expecting `','' or `';'' in C:\Program Files\EasyPHP 3.0\www\digitalTown\admin\getNews.php on line 15 I'm assuming I am just not forming my statement right because that is the line with the link. Could somebody please help me form this right? Thank you very much in advance. Tim Quote Link to comment https://forums.phpfreaks.com/topic/164134-solved-passing-a-variable-via-url-need-help/ Share on other sites More sharing options...
Maq Posted June 29, 2009 Share Posted June 29, 2009 Read about "interpolation", you were ending your string with the double quote. You can use curly brackets to escape arrays. echo " | edit"; Quote Link to comment https://forums.phpfreaks.com/topic/164134-solved-passing-a-variable-via-url-need-help/#findComment-865830 Share on other sites More sharing options...
Tjdunklee Posted June 29, 2009 Author Share Posted June 29, 2009 Thank you very much for your extremely quick help. This topic has been resolved. Quote Link to comment https://forums.phpfreaks.com/topic/164134-solved-passing-a-variable-via-url-need-help/#findComment-865834 Share on other sites More sharing options...
Maq Posted June 29, 2009 Share Posted June 29, 2009 Thank you very much for your extremely quick help. This topic has been resolved. NP. You probably don't know but there is a "Topic Solved" button in the bottom left. Quote Link to comment https://forums.phpfreaks.com/topic/164134-solved-passing-a-variable-via-url-need-help/#findComment-865837 Share on other sites More sharing options...
Tjdunklee Posted June 29, 2009 Author Share Posted June 29, 2009 Perfect! I will mark it as solved. I have a feeling I'm going to be spending a lot of time on these forums. Great place. Quote Link to comment https://forums.phpfreaks.com/topic/164134-solved-passing-a-variable-via-url-need-help/#findComment-865850 Share on other sites More sharing options...
Maq Posted June 29, 2009 Share Posted June 29, 2009 Perfect! I will mark it as solved. I have a feeling I'm going to be spending a lot of time on these forums. Great place. Welcome, that's great to hear. There are a lot of intelligent and helpful people here. Quote Link to comment https://forums.phpfreaks.com/topic/164134-solved-passing-a-variable-via-url-need-help/#findComment-865854 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.