Re: Challenge: MySql result to drop down box
- From: "Rik" <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Thu, 13 Jul 2006 15:37:31 +0200
Jim S wrote:
I think I am just missing something silly. I have tested my query and
it seems to be functioning fine. I have another similar query that
runs just before this one so the issue isn't a connection. If you
have any other questions I'd be happy to answer them.
Platform: mysql 3.x, php5
<?php
$res=mysql_query("SELECT job_name FROM oats_jobs_users_laborCode
where user='$username' order by job_name");
echo "<select name=jobname> <option default='default'>Choose
One</option>";
for ($i=0; $row=mysql_fetch_assoc($res); $i++)
{
echo "<option value='<? echo $row[0];?>'><? echo
$row[0];?></option>";
}
echo "</select>";
If you use mysql_fetch_assoc, don't use an enumerated array.
Either use mysql_fetch_assoc & $row['job_name'], or use mysql_fetch_row &
$row[0].
Grtz,
--
Rik Wasmus
.
- Follow-Ups:
- References:
- Challenge: MySql result to drop down box
- From: Jim S
- Challenge: MySql result to drop down box
- Prev by Date: Challenge: MySql result to drop down box
- Next by Date: Re: Challenge: MySql result to drop down box
- Previous by thread: Challenge: MySql result to drop down box
- Next by thread: Re: Challenge: MySql result to drop down box
- Index(es):
Relevant Pages
|