Last active
December 27, 2015 05:29
-
-
Save ricardosiri68/7274442 to your computer and use it in GitHub Desktop.
seleccionar pais
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?$countries = mysql_query("SELECT * FROM paises");?> | |
<?$userCountry = mysql_query("SELECT pais FROM users WHERE id = $userId LIMIT 1");?> | |
<select> | |
<?if($res and $user):?> | |
<?$userCountry = mysql_fetch_accoc($userCountry);?> | |
<?while($country = mysql_fetch_assoc($countries))?> | |
<option value="<?=$country['nombre']?>" | |
<?=($userCountry == $country['nombre'])? 'selected=""' : ""; ?> > | |
<?=$country['nombre']?> | |
</option> | |
<?endwhile;?> | |
<?endif;?> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment