473,480 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

syntax error, unexpected T_STRING

2 New Member
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
2 1834
chathura86
227 New Member
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
erone
2 New Member
Hello,
Thanks alot. It's been sorted out.
Regards,
Erone
Apr 4 '10 #3

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

Similar topics

4
22123
kestrel
by: kestrel | last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on. Heres what i have <?php...
36
7940
by: rhys | last post by:
My Gurus and Angels -- Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
10
2300
by: goodguyjam | last post by:
Hi again. I now get the above error with the exact same code as in my previous question. All I did was to rearrange the lines...no code changes...help! To assist you experts, line 11 contains this...
6
2602
by: goodguyjam | last post by:
Hi all, I'm having trouble with mysql. I've just finished my php coding for HTTP authentication and with some help am now getting a login window pop up whenever I click on a link on my website...
21
8508
by: Jordan79 | last post by:
I have uploaded a file and am now trying to store it in a DB. I am getting a "Parse error: syntax error, unexpected T_STRING" error on this line below: INSERT INTO gallery (user_id, image_name) ...
3
2382
by: sclarkstone | last post by:
Im getting this error; Parse error: syntax error, unexpected T_STRING, expecting ':' or ';' with this line; header ('postcodesearch.php?e=nw&pcode=',); I cant find whats wrong, can anyone...
2
3224
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
3
5581
paulrajj
by: paulrajj | last post by:
hi to all, i am getting syntax error on my code.. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62 ...
10
5619
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php ...
14
5480
riverdale1567
by: riverdale1567 | last post by:
Hi I am a newbie trying to get some of my first code working, yada yada yada. I have a drop down box which chooses a state then takes the post data to 'processform2.php' to use that to pull up...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7081
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6921
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5336
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4776
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.