-4

I want to create a form that should have a textarea as bulk input, then every row of that textarea can be store able as separate value in table via PHP.

What should I do?

Nazari
  • 358
  • 5
  • 18
H.Clean
  • 25
  • 3

2 Answers2

2

The key piece of code is:

$values = explode("\n", $_POST['textarea_name']);

Don't forget to sanitize your inserts :)

Vlad Preda
  • 9,535
  • 7
  • 32
  • 62
-1

I use this code

 $values = explode("\n", $_POST['textarea_name']);

    mysqli_query($con,"INSERT INTO `table` (`col`) VALUES ($values)");

data should be string. How I can convert it to string? I want to make each row to a record! make my code compelet!

H.Clean
  • 25
  • 3