I am writing a catologe application and i have a problem when it comes
to the edit product part. I have a table with the catogories and a table
Each table has a id column and a name column. The id column is set up in
the MySQL to auto_increment, which works fine normally, but i am writing
$sql = "SELECT * FROM cat DISTINGT ORDER BY cat_id";
$result = mysql_query($sql);
$k = 1;
while ($row = mysql_fetch_assoc($result))
echo '<label for="',$cat_name,'">',$cat_name,'<input
type="radio" name="fcat" value="',$cat_id,'" id="',$cat_id,'"';
if($k == $item_cat_id)
echo ' />';
This should (in theory) automatically check the radio button of the
existing catogory. It would work fine; but what seems to mess it up is
If i delete a catogory/manufacturer from the id's remain the same. and
end up like this:
4 Dressage Tests
but if the cat_id is 9 the /while /statement doesnt repeat 9 times so
the counter never reaches 9.
I don't know if you got all that, its hard to explain.
I would appreciate any help on how to sort this out.
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php