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....... Quote Link to comment 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>"; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.