Jump to content

Recommended Posts

I can't see the error... I'm using PHP mySQL 4.1.21 and dreamweaver8

 

 

Parse error: parse error, unexpected T_ELSE in C:\Sites\recycle_customer_update.php on line 381

 

Here's the section of code

 

<select name="abbreviation" id="abbreviation" class="text_background">

  <?php if ($error()) { ?>

  <option value=" <?php $state?>"<?php {echo "selected=\"selected\"";} ?>>Select a State</option>

  <?php else { ?>  ****this is line 381 ***

        <option value=" <?php if (!(strcmp("", $row_getCustomer['state'])))?>"<?php echo "selected=\"selected\"";} ?>>Select a State</option><?php } ?>

  <?php

  do { 

    ?>

          <option value="<?php echo $row_GetStates['abbreviation']?>"<?php if (!(strcmp($row_GetStates['abbreviation'], $row_getCustomer['state']))) {echo "selected=\"selected\"";} ?>><?php echo $row_GetStates['state_name']?></option>

          <?php

  } while ($row_GetStates = mysql_fetch_assoc($GetStates));

  $rows = mysql_num_rows($GetStates);

  if($rows > 0) {

      mysql_data_seek($GetStates, 0);

  $row_GetStates = mysql_fetch_assoc($GetStates);

  }

?>

</select>

Link to comment
https://forums.phpfreaks.com/topic/50975-help-cant-find-the-error/
Share on other sites

confusing [ code ] tags work.

 

<?php }else { ?>  ****this is line 381 ***
        <option value=" <?php if (!(strcmp("", $row_getCustomer['state'])))?>"<?php echo "selected=\"selected\"";} ?>>Select a State</option><?php } ?>

 

You have to close off the first if with a closing bracket }

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.