Jump to content

Mysql LongText to php list Box HELP


road2one

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.