Without knowing where the values of column2, column3, and column4 are coming
from it's a little hard to say what the best technique would be. Usually one
would take the POSTed value from the select control and use it to retrieve
the related data from a table in your data base.


Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341


> -----Original Message-----
> From: sam rumaizan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 03, 2007 6:51 AM
> To: mysql@lists.mysql.com
> Subject: insert data in to columns base on the selection of
> the list box.
>
>
>
> Can you help me please?
>
>
> 1-    I have created a while loop to populate the list box
> with the information of column1.
>         2-I need to update (insert data) in to column2,
> column3, column4 base on the selection of the list box.
>
>
> echo'<form>';
>
>
>
>  $query = "SELECT  column1 FROM table";
>
>    $result = mysql_query($query);
>
> echo"<br>";
>
>
>
> echo"<br>";
>
> echo"<center>";
>
>
>
>
>
> echo"<select NAME='R'>";
>
> echo"<option value='NULL'>Choose a Category:</option>
>
> ";
>
>    while ($line = mysql_fetch_array($result))
>
>    {
>
>       foreach ($line as $value)
>
>        {
>
>          echo"<OPTION value='$value'";
>
>       }
>
> echo ">$value</OPTION>";
>
>
>
>    }
>
> echo "</select>";
>
> echo "</form>";
>
>
>
>
> $sql="INSERT INTO table WHERE column1='".$_POST["R"]."'
>
>  (column2, column3, column4)VALUES('info2', 'info3', 'info4')";
>
> $result=mysql_query($sql);
>
>
>
>
>
>
>
> ---------------------------------
> No need to miss a message. Get email on-the-go
> with Yahoo! Mail for Mobile. Get started.
>




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to