0

Hi all,
i had written a query

$sql3="select userid from projectassign where projectassign='$projectassign'";
     mysql_error();
    $result3=mysql_query($sql3);
    $num1=mysql_num_rows($result3);
    $i=0;
    while ($i < $num1)
    {
        $userid=mysql_result($result3,$i,"userid");
        echo $userid;
        $i++; 
    }

so now i am getting some userid's. Now there are some checkboxes present in a table of users.Based on the query, userid's obtained i need to have them checked.
Example:
i got the userid's as 1,2,3 from the query.
Now there is checkbox to each users with userid 1,2,3,4,5. so wat i need is i need users having userid's 1,2,3 as checked in their checkboxes. so can any one please....
Thank u..

Edited by niths: n/a

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sergb
0

I'd just have one loop for 1..5 then as you output the html add an if() to check for projectassign , if true output the proper html attribute -- value="checked" or whatever it is.

0

Unchecked checkbox:

<input type="checkbox" />

Checked checkbox:

<input type="checkbox" checked="checked" />
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.