danielandlisa3144 Posted June 15, 2009 Share Posted June 15, 2009 Hi, i got a sql update script that gives me errors . i show the code and the error below. I would aprreciate some help with this. / Thanks Lisa select.php error Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 13 <? // Connect database include("connectdb.php"); // Get all records in all columns from table and put it in $result. $result=mysql_query("select * from phonebook"); /*Split records in $result by table rows and put them in $row. Make it looping by while statement. */ while($row=mysql_fetch_assoc($result)){ // Output echo "ID : $row['id'] <br/>"; echo "Name : $row['name'] <br/>"; echo "Email : $row['email'] <br/>"; echo "Tel : $row['tel'] <hr>"; // Add a link with a parameter(id) and it's value. echo '<a href="update.php?id='.$row['id'].'">Update</a>'; } mysql_close(); ?> Link to comment https://forums.phpfreaks.com/topic/162220-sql-update-script-parse-error/ Share on other sites More sharing options...
jxrd Posted June 15, 2009 Share Posted June 15, 2009 Try putting {} round your variables in the double quotes. Link to comment https://forums.phpfreaks.com/topic/162220-sql-update-script-parse-error/#findComment-856123 Share on other sites More sharing options...
danielandlisa3144 Posted June 15, 2009 Author Share Posted June 15, 2009 ok thanks you mean like this? echo "ID : $row{'id'} <br/>" Link to comment https://forums.phpfreaks.com/topic/162220-sql-update-script-parse-error/#findComment-856125 Share on other sites More sharing options...
Skepsis Posted June 15, 2009 Share Posted June 15, 2009 He means like this: <? echo "ID : {$row['id']} <br/>"; echo "Name : {$row['name']} <br/>"; echo "Email : {$row['email']} <br/>"; echo "Tel : {$row['tel']} <hr>"; ?> Link to comment https://forums.phpfreaks.com/topic/162220-sql-update-script-parse-error/#findComment-856130 Share on other sites More sharing options...
danielandlisa3144 Posted June 15, 2009 Author Share Posted June 15, 2009 Thanks alot it worked Link to comment https://forums.phpfreaks.com/topic/162220-sql-update-script-parse-error/#findComment-856193 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.