Jump to content

getting values from a textarea to use in a sql query


bolo77

Recommended Posts

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.