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" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> 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 " valign=\"top\">\n";
> echo " colspan=\"2\">Threads: class=\"adminSelectBox\">{$thread['manufacturer']}\n";
> echo "\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 "\n";
>
> echo " colspan=\"2\" style=\"font-family:monospace;color: #696565;font-size:
> 9pt;\">{$thread_colourID}{$thread_type}{$thread_colour}Available to
> Order: Yes
> if ($thread[avail] == 1) echo "
> checked"; //is this record available?
>
> echo
> "> No
> if ($thread[avail] == 0) echo "
> checked"; //is this record not available?
>
> echo ">\n";
>
> echo"\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