jakebur01 Posted December 31, 2009 Share Posted December 31, 2009 i am getting a syntax error with the line below <option value="B & R"<?php if($myrow['Store']==B %26 R) {echo' selected="selected"';}?>>B & R</option> how else can I write $myrow['Store']==B %26 R to make it go through? Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/ Share on other sites More sharing options...
Mchl Posted December 31, 2009 Share Posted December 31, 2009 Don't you mean: <option value="B & R"<?php if($myrow['Store']=="B & R") {echo' selected="selected"';}?>>B & R</option> ? Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986545 Share on other sites More sharing options...
jakebur01 Posted December 31, 2009 Author Share Posted December 31, 2009 I tried that, but it is still not taking it. PHP Parse error: syntax error, unexpected T_STRING Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986546 Share on other sites More sharing options...
jakebur01 Posted December 31, 2009 Author Share Posted December 31, 2009 I also tried this: <option value="B & R"<?php if($myrow['Store']=="B %26 R") {echo' selected="selected"';}?>>B & R</option> Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986547 Share on other sites More sharing options...
Mchl Posted December 31, 2009 Share Posted December 31, 2009 Could you paste a bit larger piece of code? There's nothing wrong with just this line. Perhaps you're missing a closing quote somewhere before. Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986548 Share on other sites More sharing options...
jakebur01 Posted December 31, 2009 Author Share Posted December 31, 2009 <select name="Store"> <option value="Academy"<?php if($myrow['Store']==Academy) {echo' selected="selected"';}?>>Academy</option> <option value="B & R"<?php if($myrow['Store']=="B %26 R") {echo' selected="selected"';}?>>B & R</option> <option value="Brookshire"<?php if($myrow['Store']==Brookshire) {echo' selected="selected"';}?>>Brookshire</option> <option value="Bass Pro"<?php if($myrow['Store']==Bass Pro) {echo' selected="selected"';}?>>Bass Pro</option> <option value="Extreme"<?php if($myrow['Store']==Extreme) {echo' selected="selected"';}?>>Extreme</option> <option value="prospect"<?php if($myrow['Store']==prospect) {echo' selected="selected"';}?>>prospect</option> </select> Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986549 Share on other sites More sharing options...
jakebur01 Posted December 31, 2009 Author Share Posted December 31, 2009 got it working now: <select name="Store"> <option value="Academy"<?php if($myrow['Store']=="Academy") {echo' selected="selected"';}?>>Academy</option> <option value="B & R"<?php if($myrow['Store']=="B & R") {echo' selected="selected"';}?>>B & R</option> <option value="Brookshire"<?php if($myrow['Store']=="Brookshire") {echo' selected="selected"';}?>>Brookshire</option> <option value="Bass Pro"<?php if($myrow['Store']=="Bass Pro") {echo' selected="selected"';}?>>Bass Pro</option> <option value="Extreme"<?php if($myrow['Store']=="Extreme") {echo' selected="selected"';}?>>Extreme</option> <option value="prospect"<?php if($myrow['Store']=="prospect") {echo' selected="selected"';}?>>prospect</option> </select> Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986550 Share on other sites More sharing options...
jakebur01 Posted December 31, 2009 Author Share Posted December 31, 2009 I was missing quotes on all the other ones. Thank you for your help. Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986552 Share on other sites More sharing options...
Mchl Posted December 31, 2009 Share Posted December 31, 2009 Be blessed the person, who invented syntax highlighting. Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986554 Share on other sites More sharing options...
jakebur01 Posted December 31, 2009 Author Share Posted December 31, 2009 What program do you edit in? Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986556 Share on other sites More sharing options...
Mchl Posted December 31, 2009 Share Posted December 31, 2009 NetBeans Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986567 Share on other sites More sharing options...
chmpdog Posted December 31, 2009 Share Posted December 31, 2009 I use notepad++ Link to comment https://forums.phpfreaks.com/topic/186819-more-ampersand-help/#findComment-986602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.