Re: Challenge: MySql result to drop down box
- From: Jim S <try@xxxxxxxx>
- Date: Thu, 13 Jul 2006 12:01:01 -0400
I think I have narrowed it down to the for loop causing the problem...
Jim S wrote:
I have made the two changes you suggested but am still not receiving a result set. Let me repost my modified code..
<?php
$res=mysql_query("SELECT DISTINCT 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_row($res); $i++)
{
echo "<option value='$row[0]'>$row[0]</option>";
}
echo "</select>";
?>
And thank you for the mysql_fecth_rows command--it was helpful in other places as well :-)
Rik wrote:And now I see this:
echo "<option value='<? echo $row[0];?>'><? echo
$row[0];?></option>";
That will not echo what you want it to echo.
Think about it, <?php ?> tags aren't nestable, why should they?
echo "<option value='$row[0]'>$row[0]</option>";
Grtz,
- Follow-Ups:
- Re: Challenge: MySql result to drop down box
- From: Norman Peelman
- Re: Challenge: MySql result to drop down box
- From: Rik
- Re: Challenge: MySql result to drop down box
- From: David
- Re: Challenge: MySql result to drop down box
- References:
- Challenge: MySql result to drop down box
- From: Jim S
- Re: Challenge: MySql result to drop down box
- From: Rik
- Re: Challenge: MySql result to drop down box
- From: Rik
- Re: Challenge: MySql result to drop down box
- From: Jim S
- Challenge: MySql result to drop down box
- Prev by Date: www.somesite.com/123213 type pages
- Next by Date: mysql5 with php4
- Previous by thread: Re: Challenge: MySql result to drop down box
- Next by thread: Re: Challenge: MySql result to drop down box
- Index(es):
Relevant Pages
|