Jump to content

Help can't find the error


jim.davidson

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 }

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.