RE: [PHP-WIN] insert data in to columns base on the selection of the list box.

From: Date: Tue, 03 Apr 2007 13:03:59 +0000
Subject: RE: [PHP-WIN] insert data in to columns base on the selection of the list box.
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-27616@lists.php.net to get a copy of this message
When you say "update in to column2, column3..." are you referring to the list boxes or database tables? If it's the list boxes, are you wanting this to happen on the client side? Or are you putting the data all out at once? -----Original Message----- From: sam rumaizan [mailto:samcalc@yahoo.com] Sent: Tuesday, April 03, 2007 8:00 AM To: php-windows@lists.php.net Cc: php-windows-info@lists.php.net Subject: [PHP-WIN] 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 (add 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="UPDATE $tbl_name SET column2 = CONCAT(column2, '$_POST[column2]', column3 = CONCAT(column3, '$_POST[column3]',column4 = CONCAT(column4, '$_POST[column4]' WHERE Assign_Engineer ='".$_POST["R"]."'"; $result=mysql_query($sql); --------------------------------- No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started.

« previous php.windows (#27616) next »