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? Quote Link to comment 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> ? Quote Link to comment 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 Quote Link to comment 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> Quote Link to comment 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. Quote Link to comment 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> Quote Link to comment 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> Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted December 31, 2009 Author Share Posted December 31, 2009 What program do you edit in? Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 31, 2009 Share Posted December 31, 2009 NetBeans Quote Link to comment Share on other sites More sharing options...
chmpdog Posted December 31, 2009 Share Posted December 31, 2009 I use notepad++ 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.