Hi,
Is there a way to populate a select tag, in an insert form, with table content ? And if it's possible, how can I insert into new table, into specific field, the selection I made ?
Thanks
Carlo
Select from table
Moderator: General Moderators
I hope this is what you are looking for!
Code: Select all
$Mp2SomResult = MSSQL_QUERY($query);
$number = MSSQL_NUM_ROWS($Mp2SomResult);Code: Select all
<Select Name='Location'>
<Option></Option>
<?
$i=0;
if ($number > 0) :
while ($i < $number) :
$Location = mssql_result($Mp2SomResult,$i,"Location");
print "<Option Value='$Location'>$Location</Option>";
$i++;
endwhile;
endif;
?>
</Select>Code: Select all
I think of yes
Thanks,
I asked for MySQL solution, but I think is the same way ... I asked also how to insert info from select variable (in your case $Location) to MySQL field destination.
For example if I use a table:
ID
Location
How can I insert Location content ?
Thanks
Carlo
I asked for MySQL solution, but I think is the same way ... I asked also how to insert info from select variable (in your case $Location) to MySQL field destination.
For example if I use a table:
ID
Location
How can I insert Location content ?
Thanks
Carlo