Re: Database value as selected in combo box!

[email protected] (cybot) Mon, 03 Feb 2003 18:47:57 +0100
Newsgroups php.lang
Message-ID <[email protected]>
if have no debugger just use some echo() to see whats going on

Anthony Judd wrote:
> i have also tried:
> 
> function retrieve_category()
>  {
>   $cat = mysql_query("SELECT category_id FROM category");
>   while ($current_row = mysql_fetch_row($cat))
>    {
echo $current_row[0] . ' == ' . $id . '? ' . intval($row == $id);

with this you should see whats wrong
>        $row = $current_row[0]; //changed here
>        if ($row == $id)
>          {
>            printf("<option selected>%s</option>\n",$current_row[0]);
>          }
>         else
>          {
>            printf("<option>%s</option>\n",$current_row[0]);
>          }
>    }
>  }
> 
> 
> 
> 

-- 
Sebastian Mendel

[email protected]

www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com