Re: Challenge: MySql result to drop down box
- From: "Johnny" <removethis.huuanito@xxxxxxxxxxx>
- Date: Thu, 20 Jul 2006 20:41:52 -0700
Hmmm... u got some explainin to do.
what is wrong $username as a variable name? it's not a reserved word AFAIK
in either PHP or MySql
perhaps you are using it in another part of your code that you did not
disclose....thus making it a challenge for us to help you ;-)
As I said back on the 13th your revised code works for me.
"Jim S" <try@xxxxxxxx> wrote in message news:vY5vg.161$XR1.102@xxxxxxxxxxx
Ok--I found the problem. After beating my head on it for a few days Iwhere
realized the $username variable should have actually been $user_name O.o
Thank you for all who helped, I am sure the solutions I did implement
helped me to avoid other problems.
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
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>";
?>
.
- References:
- Re: Challenge: MySql result to drop down box
- From: Jim S
- Re: Challenge: MySql result to drop down box
- Prev by Date: Re: HELP: setting SMTP in own server
- Next by Date: Re: validate file name using regular expression
- 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
|