Jump to content


Photo

Display MYSQL data into textboxes through drop down box PLEASE help ME!


  • Please log in to reply
2 replies to this topic

#1 newbiehacker

newbiehacker
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 01 August 2006 - 08:23 PM

Hi Ill try to keep this short I have a drop down box that is fed by a mysql data base. the code is here.
$sql = "select * from role";
$Pass = $db->query($sql);

echo '<tr><td>Role:</td><td><select name="role"><option>Add Role</option>';
while($row = $Pass->fetchRow()){
$role = $row[0];

echo '<option value='.$role.'>'.$role.'</option>';
 
  }
echo '</select>';

I need to fill a fill a form that has textboxes in which it grabs the value from the dropbox and fills the form with the values in this database here
+-----------+------+--------+-----------+-------------+
| extension | dnd  | paging | fkey_0    | fkey_1      |
+-----------+------+--------+-----------+-------------+
| default  | off    | on    |          |            |
| trial      | off    | on  | dest *123 | dest *124  |
| test      | on  | on    | *123      | *123        |
| test3    | off  | on    | dest *321 | dtmf ##1123 |
+-----------+------+--------+-----------+-------------+
Please help if you can I will be most gratefull

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 01 August 2006 - 08:45 PM

what is in "role"? which column will it match in the other table?
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 newbiehacker

newbiehacker
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 01 August 2006 - 09:15 PM

sorry, the role is representing the extension field I need to grab whatever is in the dropdown box which is the extension field and populate the form with the other fields related to the extension field




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users