I have a form with a multiline textarea. I'm trying to post this form to the same page, and grab each line and insert it into a MySQL db. I know how to do most of it, but i'm having problem with this part. There are notes and questions in the following code. Thanks in advance.
Code:
<?php
//open db connection
include '../includes/config.php';
include '../includes/opendb.php';
if(isset($_POST['leads'])){
////I don't Know What to do here????
////Each line of textarea input would be like:
//// 1234 10.00
//// 1235 10.00
//// 1237 12.00
////I want to have each line of the array be broke into $leadid and $price.
////Then UPDATE like "UPDATE clicks SET leadprice = $price WHERE id = $leadid"
////How do I do this? I think the two variables are tab delimited on each line of the array
} else {
?>
<FORM action="form.php" method="POST">
<LABEL>Enter Lead IDs below:</LABEL><br>
<textarea multiple name="leads" cols="60" rows="30"></textarea><br>
<INPUT type="submit" value="Add Lead IDs to Database">
</FORM>
<?php
}
include '../includes/closedb.php';
?>