bolo77 Posted March 18, 2007 Share Posted March 18, 2007 im trying to retrieve the text entered within a text area, split it into indiviual lines and use each line within a sql statement I can retrieve the values but only the 1st value is inserted within the sql statement can anyone help? if ($STAGE == 11) { $ordernumbera = explode("\n", $p_ordernum); $Count = count($ordernumbera); echo $Count; for ($i=0; $i < $Count; $i++) { $arr_words = $ordernumbera[$i] ; echo $arr_words ; } ?> <form method="POST" action=/admin/paymentrequest.php> <table> <tr><td>Date</td><td>Order Number</td><td>Artist Cost (Yen)</td><td>Request Payment</td></tr> <? $sql ="DROP TABLE IF EXISTS tempfinance1"; $result=mysql_query($sql); $sql = "CREATE TABLE tempfinance1 SELECT tracking_id, tracking_date, tracking_total, order_shippingcost, item_artistcost, trackitem_quantity, tracking_shippingtotal, tracking_firstname, tracking_lastname from (((trackitem left join item_status on item_tkid=trackitem_id) left join tracking on tracking_id = trackitem_tracknum) left join order_status on order_number=tracking_id) WHERE tracking_id in ('$arr_words')"; $result=mysql_query($sql); echo $sql; $sql = "INSERT INTO tempfinance1 SELECT tracking_id, tracking_date , tracking_total , order_shippingcost , item_artistcost, trackitem_quantity, tracking_shippingtotal, tracking_firstname, tracking_lastname from trackitemmanual left join trackingmanual on trackitem_tracknum = tracking_id WHERE tracking_id in ('$arr_words')"; echo $sql; $result=mysql_query($sql); Link to comment https://forums.phpfreaks.com/topic/43258-getting-values-from-a-textarea-to-use-in-a-sql-query/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.