Ummm, though of this after I sent the e-mail: you may even perform the line after 
list($checked)... with an if in the query and skip the line altogether. But that may 
be a little too much... :-)


Bogdan Stancescu wrote:

>   while ($row = mysql_fetch_array($result))
>   {
>    echo $row["name"];
>    list($checked)=mysql_fetch_row(mysql_query("select user_id from User_Category 
>where user_id='$current_user' and category_id='".$row["category_id"]."'"));
>    $checked=$checked?" checked":"";
>    echo '<input type="checkbox" name="cat[]" value='.$row["category_id"].'$checked>';
>   }

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to