Parse Error : unexpected T_ENCAPSED_AND_WHITESPACE, expectin

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Maluendaster
Forum Contributor
Posts: 124
Joined: Fri Feb 25, 2005 1:14 pm

Parse Error : unexpected T_ENCAPSED_AND_WHITESPACE, expectin

Post by Maluendaster »

I got this error :

unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

in this line

Code: Select all

echo "<td><a href=link?id=$result['ID_Prueba']>$result['Nombre']</a></td><td>$result['Url']</td><td>$result['Imagen']</td><tr>";
Anyone knows what's wrong???

thank you!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

post the surrounding lines, that one does not appear to have any errors.

Personally, I escape all variables (generally because I use single quotes more often) but even with double quotes as well to promote readability

ie.

Code: Select all

echo "<td><a href=link?id=".$result['ID_Prueba'].">".$result['Nombre']."</a></td><td>".$result['Url']."</td><td>".$result['Imagen']."</td><tr>";
Maluendaster
Forum Contributor
Posts: 124
Joined: Fri Feb 25, 2005 1:14 pm

Post by Maluendaster »

Jcart wrote:post the surrounding lines, that one does not appear to have any errors.

Personally, I escape all variables (generally because I use single quotes more often) but even with double quotes as well to promote readability

ie.

Code: Select all

echo "<td><a href=link?id=".$result['ID_Prueba'].">".$result['Nombre']."</a></td><td>".$result['Url']."</td><td>".$result['Imagen']."</td><tr>";
it worked!! but i still need to change some stuff... I hope i can make it on my own!

thanks so much!
Post Reply