By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,946 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,946 IT Pros & Developers. It's quick & easy.

syntax error, unexpected T_STRING

P: 2
Hello, good morning.
I have a syntax error here. Can you help? Thanks. It's a Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
on the "echo" line :
Expand|Select|Wrap|Line Numbers
  1. <?
  2.     $sql = "SELECT addrid, nickname FROM favlsit WHERE owner = '$username'";
  3.     $result = mysql_query($sql);
  4. while ($rand = mysql_fetch_assoc($result)) {
  5.  
  6.  
  7.     $check = mysql_query("SELECT phone FROM addressbook WHERE id = '$rand[addrid]'");
  8.     $row = mysql_fetch_row($check);
  9.     echo " <tr><td height=18 bgcolor=EEEEEE><a href="javascript:AddReceiver('$row[0]')" class="o">
  10.             $rand[nickname]</a></td></tr>";
  11. }
  12.  
  13.  
  14. ?>
Apr 4 '10 #1
Share this Question
Share on Google+
2 Replies


chathura86
100+
P: 227
you have to escape "

Expand|Select|Wrap|Line Numbers
  1. echo " <tr><td height=18 bgcolor=EEEEEE><a href=\"javascript:AddReceiver('$row[0]')\" class=\"o\">$rand[nickname]</a></td></tr>";
  2.  
regards.
Apr 4 '10 #2

P: 2
Hello,
Thanks alot. It's been sorted out.
Regards,
Erone
Apr 4 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.