Created
June 9, 2011 13:40
-
-
Save erkattak/1016745 to your computer and use it in GitHub Desktop.
Looping SQL results
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
<?php | |
// get your sql results, etc | |
$results = mysql_query('SELECT * FROM table'); | |
?> | |
<form> | |
<fieldset> | |
<legend>Your Legend</legend> | |
<select name="editlist"> | |
<?php while($row = mysql_fetch_result($results, MYSQL_ASSOC) : ?> | |
<option value="<?php echo $row['companyname']; ?>"><?php echo $row['companyname']; ?></option> | |
<?php endwhile; ?> | |
</select> | |
</fieldset> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment