road2one Posted December 13, 2007 Share Posted December 13, 2007 I need to get the data from a Mysql DB Table Names Productions (LongText Box) Exp. Production 1 Production 2 Production 3 Production 4 Production 5 Production 6 To a list BOX using PHP I tryed this ----------------------- PHP Code: </select> <select multiple name="toBox" id="toBox"> <? $id2=$_GET['id']; queryReq2 =$id2; $query2= "SELECT id, Productions FROM Models where id='$queryReq2'"; $result2=mysql_query($query2); echo mysql_error(); while (list($idN,$Productions)= mysql_fetch_array($result2)) { echo '<option value="'.$idN.'">'.$Productions.'</option>'; ?> ------------- I only get the first line populated from the options ... I need each production to get a option and I been trying and can't figure it out. HELP....... Link to comment https://forums.phpfreaks.com/topic/81575-mysql-longtext-to-php-list-box-help/ Share on other sites More sharing options...
farkewie Posted December 14, 2007 Share Posted December 14, 2007 Give this ago, you may need to change the values in the select boxes to suit your mysql table cols <?php $query2 = "SELECT id, Productions FROM Models where id='" . $_GET['id'] . "'"; if ( ! $result2 = mysql_query($query2) ) { echo "Error : " . mysql_error(); } die; print "<select multiple name=\"toBox\" id=\"toBox\">"; while ( $row = mysql_fetch_array($result2) ) { print "<option value=\"" . $row['idN'] . "\">" . $row['Productions'] . "</option>"; } print "</select>"; ?> Link to comment https://forums.phpfreaks.com/topic/81575-mysql-longtext-to-php-list-box-help/#findComment-414625 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.