How to get values from SQL query made by php?
Posted
by Ole Jak
on Stack Overflow
See other posts from Stack Overflow
or by Ole Jak
Published on 2010-03-15T14:09:09Z
Indexed on
2010/03/15
14:09 UTC
Read the original article
Hit count: 154
So I made a query like this
global $connection;
$query = "SELECT *
FROM streams ";
$streams_set = mysql_query($query, $connection);
confirm_query($streams_set);
in my DB there are filds
ID, UID, SID, TIME (all INT type exept time)
So I am triing to print query relult into form
<form>
<select class="multiselect" multiple="multiple" name="SIDs">
<?php
global $connection;
$query = "SELECT *
FROM streams ";
$streams_set = mysql_query($query, $connection);
confirm_query($streams_set);
$streams_count = mysql_num_rows($streams_set);
for ($count=1; $count <= $streams_count; $count++) {
echo "<option value=\"{$count}\"";
echo ">{$count}</option>";
}
?>
</select>
<br/>
<input type="submit" value="Submit Form"/>
</form>
How to print out as "option" "values" SID's from my sql query?
© Stack Overflow or respective owner