Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do i fix php my admin adding multiple line records as one record

So i was trying to add records to my database using php my admin like this:

data1
data2
data3

And since i ran into an issue where it says:

#1406 - Data too long for column 'data' at row 2

And realised that its trying to add all those lines ( one line = one new record ) as one line of data instead of making each line a record.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

( I apologise for my lack of terminology I am fairly new to this )

here is my "data" column
my "data" column

its in varchar and should accept 255 characters max for each line

>Solution :

Learn the SQL language.

It should be like this:

INSERT INTO tbl_name (data) VALUES(data1),(data2),(data3);

In the phpMyAdmin interface add one entry per field. He doesn’t understand what you want by separating the lines with a line break.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading