Page 1 of 1

echo problem in field

Posted: Fri Aug 15, 2003 7:29 am
by zuzupus
hi,

i created radio button which retrieves value from database (all are directories and childs which also shown in left frame as trees)let say

//all are radio buttons
-SPECIALS
-EXPO
2001 IAA FF
2001 ss Motorshow
2002 Autosalon Geneve

so when i select any of the directoy they have some id ,and each file have particular users depends on id

Code: Select all

<input type="radio" name="ddir"
$r2 = query_db("SELECT u.name FROM t_user u INNER JOIN tr_directories_user r ON r.fk_t_user=u.sys_pk WHERE r.fk_t_directories=".$r->sys_pk);
                                                               onClick="document.enableform.users.value='<?php   echo htmlentities($r2->name);
 ?>'" value="<?=$r->sys_pk ?>" id="dir<?=$r->sys_pk ?>" />
when i run below query in MYSQL i get users name
SELECT u.name FROM t_user u INNER JOIN tr_directories_user r ON r.fk_t_user=u.sys_pk WHERE r.fk_t_directories='514' // id of SPECIALS
and i get users name like

VD DD
VD CC
VD PP

now problem is I think the OnClick is wrong please modify it as i dont no

second one i created one field i dont know how to print above users in this field. and i no users exists then print NO USERS FOUND.

<td class="black2">Users:</td>
<td>
<input type="hidden" name="users" value="" />
</td>

please help me for right approach whether i have to create different field or i have to put echo on ONCLICK

I am confused :(

Thanks in advance