0
I would like to know how I can make use of textarea together with php and mysqli to do the following need to send 12 items within a textarea and that these items are put with line break and that apply these 12 items in mysqli and if not post all 12 not error only need max only allow 12 items per textarea, Pole case smaller than equal to 12 works perfectly.
Because I have in the table 12 fields to put the links.
In case I need you to send the form textarea and SQL below so that each position in the case and a column in the table media that goes from the column link1 to link12.
<textarea rows="12" name="links">
link1
link2
link3
link4
link5
link6
link7
link8
link9
link10
link11
link12
</textarea>
Mysql
CREATE DATABASE `media` ;
CREATE TABLE `media`.`medias` (
`id` INT( 5 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`link1` VARCHAR( 255 ) NOT NULL ,
`link2` VARCHAR( 255 ) NOT NULL ,
`link3` VARCHAR( 255 ) NOT NULL ,
`link4` VARCHAR( 255 ) NOT NULL ,
`link5` VARCHAR( 255 ) NOT NULL ,
`link6` VARCHAR( 255 ) NOT NULL ,
`link7` VARCHAR( 255 ) NOT NULL ,
`link8` VARCHAR( 255 ) NOT NULL ,
`link9` VARCHAR( 255 ) NOT NULL ,
`link10` VARCHAR( 255 ) NOT NULL ,
`link11` VARCHAR( 255 ) NOT NULL ,
`link12` VARCHAR( 255 ) NOT NULL ,
) ENGINE = MYISAM ;
what you have already managed to do? has some example to add in the question ?
– Gabriel Rodrigues
Unfortunately I not only have the text area and Mysql data.
– Striffer
Show how data is sent in the textarea?
– rray
I edited the question
– Striffer
The ideal was a single link column plus the
id
from some other table. If it is not possible to change this from$link = explode("\n",$_POST['textarea']);
– rray
in case for me to put in the position I want I will have to do something like $link1 = $link[0]; until $link12 = $link[11]; right ?
– Striffer