Hi, perhaps it is a stupid question, but have you put a space caractere before checked ? Did you type : if ($thread[avail] == 0) echo " checked"; //is this record not available? or if ($thread[avail] == 0) echo "checked"; //is this record not available? Other question : Is avail a constant ? If not, but it between quotes. Stf "Aaron Wolski" <aaronjw@martekbiz.com> a écrit dans le message de news: 001401c351df$9537ba00$0303a8c0@AJW2... > Hi Guys.. hopefully someone can help with this. > > Code: > > $query = "select t.id, t.thread_index, t.pattern_index, > t.avail, p.id, p.type, p.colour, p.colourID, p.manufacturer FROM > kcs_patternthreads t LEFT JOIN kcs_threads p ON t.thread_index = p.id > WHERE t.pattern_index = $id"; > > $thread_manufacturer = ''; > > $result = db_query($query); > while($thread = db_fetch($result)) { > > if($thread_manufacturer != > $thread['manufacturer']) { > > echo "<tr > valign=\"top\">\n"; > echo " <td > colspan=\"2\"><font class=\"adminHeader\">Threads:</font> <font > class=\"adminSelectBox\">{$thread['manufacturer']}</font></td>\n"; > echo "</tr>\n"; > $thread_manufacturer = > $thread['manufacturer']; > > } > > $thread_colourID = > str_pad($thread['colourID'], 8, " ", STR_PAD_RIGHT); > $thread_type = str_pad($thread['type'], > 20, " ", STR_PAD_RIGHT); > $thread_colour = > str_pad($thread['colour'], 20, " ", STR_PAD_RIGHT); > > $thread_colourID = str_replace(" > "," ", $thread_colourID); > $thread_type = str_replace(" "," ", > $thread_type); > $thread_colour = str_replace(" > "," ", $thread_colour); > > echo "<tr valign=\"middle\">\n"; > > echo " <td > colspan=\"2\" style=\"font-family:monospace;color: #696565;font-size: > 9pt;\">{$thread_colourID}{$thread_type}{$thread_colour}Available to > Order: Yes<input type=\"radio\" name=\"avail\" value=\"1\""; > > if ($thread[avail] == 1) echo " > checked"; //is this record available? > > echo > "> No<input type=\"radio\" name=\"avail\" value=\"0\""; > > if ($thread[avail] == 0) echo " > checked"; //is this record not available? > > echo "></td>\n"; > > echo"</tr>\n"; > } > > END CODE > > Everything on this script works except the radio button "checked" part. > > What's supposed to happen is if $thread[avail] == 1 then display the YES > radio as "checked" for that record and if $thread[avail] == 0 then > display the NO radio as checked for that record. > > I did an echo on $thread[avail] and I get the correct values: > > 0 > 1 > 0 > > > Does anyone have a clue as to my problem here? > > Thanks in advance! > > Aaron > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php