You are here: Re: Challenge: MySql result to drop down box « All PHP « IT news, forums, messages
Re: Challenge: MySql result to drop down box

Posted by Jim S on 07/13/06 14:41

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,

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация