I have the following PHP file with a datagrid. I would like that all the cells of a spefic column include a combobox in order to allow the user to select one of the item.
This PHP script implement the select that I hope to have in the specific cell of the datagrid.
echo "<select id=\"List\" name=\"List\">";
$res = mysql_query("SELECT field1, field2 FROM table1 ORDER BY field0");
while ($db_data = mysql_fetch_row($res)) {
$ItemID = $db_data[0];
$ItemNAME = $db_data[1];
echo "<option value=\"".$ItemID."\">".$ItemNAME."</option>";
}
echo "</select>";
This PHP scipt extract from the DB the information I want to show in the grid.
[code]
$gridContent = “”;
$res_Info = mysql_query(“SELECT * FROM table2 ORDER BY field1”);
while ($db_data_Info = mysql_fetch_row($res_Info)) {
$field1 = $db_data_Info[0];
$field2 = $db_data_Info[1];
$field3 = $db_data_Info[2];
$field4 = $db_data_Info[3];
$gridContent .= "[\"".$field1."\",\"".$field2."\",\"".$field3."\",\"".$field4."\"],";
}[/code]
The following code implement the datagrid.
[code]
[/code]As you can see, the code include 5 column…but I have the information only for 4 of them. I would like the 5th column include the combo defined in the first block of code.
I hope anybody can help me
Thanks