PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 11, 2022

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

 October 11, 2022     php, phpmyadmin     No comments   

Issue

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.

( 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.



Answered By - Tupical
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing