I am trying to create a list box that is populated by a table.
The basic HTML code is
*-*
<TD><select name="driver" class="textarea" maxlength="50"><option value="100">Fred</option><option value="101">Flossie</select></TD>
*-*
I have created PHP code to buld the whole string
*-*
$cList = '<TD><select name="driver" class="textarea" maxlength="50">';
$cQuery = "SELECT `driver`,`name`,`vantype` FROM `drivers`";
$res = mysql_query($cQuery,$cMysql);
if ($res){
while ($row = mysql_fetch_array($res, MYSQL_NUM)){
$cList.= '<option value="' ;
$cList.= strval($row[0]);
$cList.= '"';
$cList.= '>';
$cList.= $row[1];
$cList.= '</option' ;
}
}
$cList.= '</select></TD>' ;
*-*
I have left out some bits to improve clarity, I am using macromedia to edit the file, the machine is XP & I have the databases & PHP set up on my webserver which is many miles away
The basic HTML code is
*-*
<TD><select name="driver" class="textarea" maxlength="50"><option value="100">Fred</option><option value="101">Flossie</select></TD>
*-*
I have created PHP code to buld the whole string
*-*
$cList = '<TD><select name="driver" class="textarea" maxlength="50">';
$cQuery = "SELECT `driver`,`name`,`vantype` FROM `drivers`";
$res = mysql_query($cQuery,$cMysql);
if ($res){
while ($row = mysql_fetch_array($res, MYSQL_NUM)){
$cList.= '<option value="' ;
$cList.= strval($row[0]);
$cList.= '"';
$cList.= '>';
$cList.= $row[1];
$cList.= '</option' ;
}
}
$cList.= '</select></TD>' ;
*-*
I have left out some bits to improve clarity, I am using macromedia to edit the file, the machine is XP & I have the databases & PHP set up on my webserver which is many miles away