Well...
 
I actually solved this an hour ago.
 
$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);
for ($i=0;$thread = db_fetch($result);$i++) {
 
echo "".$thread['avail']."<br>";
 
                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(" ","&nbsp;",
$thread_colourID);
                $thread_type = str_replace(" ","&nbsp;", $thread_type);
                $thread_colour = str_replace(" ","&nbsp;",
$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: &nbsp;Yes<input type=\"radio\" name=\"avail[{$i}]\" value=\"1\"";
                if ($thread['avail'] == "1") echo " checked";
                                echo ">&nbsp;&nbsp;&nbsp;No<input
type=\"radio\" name=\"avail[{$i}]\" value=\"0\"";
                if ($thread['avail'] == "0") echo " checked";
                                echo "></td>\n";
                echo"</tr>\n";

 
}
 
 
Notice: for ($i=0;$thread = db_fetch($result);$i++) {
 
And : name=\"avail[{$i}]\"
 
This gives me what I am looking for :-)
 
Aaron
-----Original Message-----
From: Stf [mailto:[EMAIL PROTECTED] 
Sent: July 24, 2003 10:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: dynamic radio buttons.. checked or not?
 
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
 
 
 
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 

Reply via email to