Jump to content

Archived

This topic is now archived and is closed to further replies.

newbiehacker

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

Recommended Posts

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

Share this post


Link to post
Share on other sites
what is in "role"? which column will it match in the other table?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.