Re: Database value as selected in combo box!
| From: | cybot | Date: | Mon, 03 Feb 2003 17:47:57 +0000 |
| Subject: | Re: Database value as selected in combo box! | ||
| References: | 1 2 | Groups: | php.lang |
| Request: | Send a blank email to php-lang+get-455@lists.php.net to get a copy of this message | ||
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
info@sebastianmendel.de
www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com