anonymousbob Posted May 30, 2006 Share Posted May 30, 2006 I am using Dreamweaver to build a mySQL-PHP website. An update record page with two dynamic menus is not functioning - it shows the error:Parse error: syntax error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [i][!--coloro:#666666--][span style=\"color:#666666\"][!--/coloro--]updatepage[[!--colorc--][/span][!--/colorc--]/i].php on line 218[b]Recordset info:[/b]rsVoter: calling record to be updatedrsPrecincts: calls dynamic menu #1's info[b]line 218 reads:[/b] <option value="<?php echo $row_rsPrecincts['votingprecinct_id']?>"<?php if (!(strcmp($row_rsPrecincts['votingprecinct_id'], "$row_rsVoter[\'votingprecinct_id\']"))) {echo "SELECTED";} ?>><?php echo $row_rsPrecincts['precinctname']?></option>[b]and it is followed on the next line by:[/b] <?php} while ($row_rsPrecincts = mysql_fetch_assoc($rsPrecincts)); $rows = mysql_num_rows($rsPrecincts); if($rows > 0) { mysql_data_seek($rsPrecincts, 0); $row_rsPrecincts = mysql_fetch_assoc($rsPrecincts); }?>[b]Is there a glaring syntax error on line 218 that my untrained eye has missed?[/b] Quote Link to comment https://forums.phpfreaks.com/topic/10761-php-syntax-error/ Share on other sites More sharing options...
Honoré Posted May 30, 2006 Share Posted May 30, 2006 try this one:[code]<option value="<?php echo $row_rsPrecincts['votingprecinct_id']?>"<?php if (!(strcmp($row_rsPrecincts['votingprecinct_id'], $row_rsVoter['votingprecinct_id']))) {echo "SELECTED";} ?>><?php echo $row_rsPrecincts['precinctname']?></option>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10761-php-syntax-error/#findComment-40196 Share on other sites More sharing options...
anonymousbob Posted May 30, 2006 Author Share Posted May 30, 2006 Thanks, Honoré, that did the trick! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/10761-php-syntax-error/#findComment-40198 Share on other sites More sharing options...
etoper Posted June 20, 2006 Share Posted June 20, 2006 [!--quoteo(post=378330:date=May 30 2006, 04:14 AM:name=Honoré)--][div class=\'quotetop\']QUOTE(Honoré @ May 30 2006, 04:14 AM) [snapback]378330[/snapback][/div][div class=\'quotemain\'][!--quotec--]try this one:[code]<option value="<?php echo $row_rsPrecincts['votingprecinct_id']?>"<?php if (!(strcmp($row_rsPrecincts['votingprecinct_id'], $row_rsVoter['votingprecinct_id']))) {echo "SELECTED";} ?>><?php echo $row_rsPrecincts['precinctname']?></option>[/code][/quote]Hi, I'm a little new to PHP, not so much dreamweaver, and i was wondering, how did you know that, that was the mistake? can you please explain more about it.. thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/10761-php-syntax-error/#findComment-47742 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.