Advertisement
brunofagis

Untitled

Sep 1st, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <select name="cod_estados" id="cod_estados" class="form-control" required>
  2. <?php
  3. $sql = "SELECT cod_estados, sigla, nome
  4. FROM estados
  5. ORDER BY sigla";
  6. $res = mysql_query( $sql );
  7. while ( $row = mysql_fetch_assoc( $res ) ) {
  8.  
  9. ?>
  10. <option label="<?php echo $row['nome']; ?>" value="<?php echo $row['cod_estados']; ?>" <?php if (strcasecmp($vetoruser['estado'], $row['cod_estados']) == 0) : ?>selected="selected"<?php endif; ?>><?php echo $row['nome']; ?></option>
  11. <?php
  12.  
  13. }
  14.  
  15. ?>
  16. </select>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement