I have a simple form which is a textarea and I need to insert each lines in my textarea into a different rows in MySQL.
HTML code:
This should work:
$textarea = mysql_real_escape_string($_POST['url']); $array = explode("\n", $textarea); foreach ($array as $value) { mysql_query("INSERT INTO test (text) VALUES ('".$value."')") or die(mysql_error()); }