usadarts Posted April 19, 2006 Share Posted April 19, 2006 Hello all,[code] if($row['approved']= "Y"){ $sanctioned = "<img src="/pictures/approved.jpg">" } [/code]Receiving the following error:Parse error: parse error, unexpected T_STRING in public_html/tournaments/calendar/test2.php on line 70Thanks,David Quote Link to comment Share on other sites More sharing options...
poirot Posted April 19, 2006 Share Posted April 19, 2006 You must escape the double quotes in the string:[code] if($row['approved']= "Y"){ $sanctioned = "<img src=\"/pictures/approved.jpg\">" } [/code]Or use this single quotes:[code] if($row['approved']= "Y"){ $sanctioned = '<img src="/pictures/approved.jpg">' } [/code] Quote Link to comment Share on other sites More sharing options...
Orio Posted April 19, 2006 Share Posted April 19, 2006 Thats because you used inside the double quotes, double quotes.This should work:[code]if($row['approved']= "Y"){ $sanctioned = '<img src="/pictures/approved.jpg">' }[/code]Orio.EDIT- hehe poirot you are faster :D Quote Link to comment Share on other sites More sharing options...
usadarts Posted April 19, 2006 Author Share Posted April 19, 2006 Changed code to:[code] if($row['approved']= "Y"){ $adosanctioned = '<img src="/pictures/approved.jpg">' }[/code]Now getting this error:Parse error: parse error, unexpected '}' in /public_html/tournaments/calendar/test2.php on line 71 Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 19, 2006 Share Posted April 19, 2006 You forgot the terminating semi-colon on this line:[code]<?php $adosanctioned = '<img src="http://www.adodarts.com/pictures/approved.jpg">' ?>[/code]Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.