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
Maluendaster
Forum Contributor
Posts: 124 Joined: Fri Feb 25, 2005 1:14 pm
Post
by Maluendaster » Wed Jan 25, 2006 3:38 pm
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!
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Wed Jan 25, 2006 4:55 pm
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 » Wed Jan 25, 2006 5:28 pm
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!