Multi unos podataka - da svaki novi red u formi bude novi unos u bazi

kako da napravim da mi svaki novi red u formi bude novi unos u bazi
tako naprimjer

1-nešto
2-nešto
3-nešto
4-nešto
5-nešto

bude 5 unosa u bazi

$string = “pomocu
explode
funkcije”;

$lines = explode( “\n”, $string );

možeš li izvest to unutar koda pošto ja ne uspjevam

<form action="" method="post">
First Name: <textarea name="joke" cols='60' rows='10'></textarea>

<input name="add" type="submit" value="Submit to Database" />
</form>
<?php
if(isset($_POST['add'])){
	$joke = $_POST['joke'];
	@mysql_query("INSERT INTO jokes SET joke='$joke' ");
	echo "Hello $joke, Your data has been submitted to database";
}?>

[php]if (isset($_POST[‘add’]))
{
$joke = $_POST[‘joke’];

$lines = explode("\n", $joke);

foreach ($lines as $val)
{
    @mysql_query('INSERT INTO jokes SET joke = "' . $val . '"');
    echo "Hello $joke, Your data has been submitted to database";
}

}
[/php]

jojo uskače kad je najpotrebnije hvala ovo je mislim tisućuti put :slight_smile:

Past ce pivo :smiley:

može :smiley: :smiley:

Došem bude novac avaible na paypalu šaljem pivu :slight_smile:


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja