Jump to content

Recommended Posts

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 updated
rsPrecincts: 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]
Link to comment
https://forums.phpfreaks.com/topic/10761-php-syntax-error/
Share on other sites

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]
Link to comment
https://forums.phpfreaks.com/topic/10761-php-syntax-error/#findComment-40196
Share on other sites

  • 3 weeks later...
[!--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..
Link to comment
https://forums.phpfreaks.com/topic/10761-php-syntax-error/#findComment-47742
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.