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 Link to comment https://forums.phpfreaks.com/topic/7864-code-coming-up-with-error/ 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] Link to comment https://forums.phpfreaks.com/topic/7864-code-coming-up-with-error/#findComment-28653 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 Link to comment https://forums.phpfreaks.com/topic/7864-code-coming-up-with-error/#findComment-28654 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 Link to comment https://forums.phpfreaks.com/topic/7864-code-coming-up-with-error/#findComment-28658 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 Link to comment https://forums.phpfreaks.com/topic/7864-code-coming-up-with-error/#findComment-28660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.