• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
extend error

[eluser]Mitja B.[/eluser]
Hi, i have one small problem

now i get error like this
A Database Error Occurred

Error Number: 1406

Data too long for column 'naslov_podjetja' at row 1

INSERT INTO `narocnik` (`ime_podjetja`, `naslov_podjetja`, `davcna_stevilka`, `telefon`, `mail`, `kontaktna_oseba`, `postna_stevilka`, `posta`, `geslo`, `datum`) VALUES ('<img src="http://www.freewebs.com/ljuba/SLIKA 1.JPG" />', '<a href="http://www.freewebs.com/ljuba/SLIKA 1.JPG">BLA</a>', '43243243', '432432432', '[email protected]', '[email protected]', '2133', 'dasd', '4124bc0a9335c27f086f24ba207a4912', '2009-02-12')

How can i extend erro that i will get just message

Data too long for column 'naslov_podjetja' and nothing else or some other error wihout code


Sounds like the column might be a varchar that's not long enough to store the data you're trying to store. You should check that through phpMyAdmin or equivalent, and also see how long the data you're trying to add is. There should ideally be some kind of validation before the insert procedure to ensure someone hasn't entered more data than the database column has space for.

[eluser]Mitja B.[/eluser]
Thx for your answer. Yes maxlength is 80 and i have that maxlength must be no more than 80.

Problem is that i use htmlspecialchars validation and if i use <a

If you're using CodeIgniter's form validation library, you might want to try having the length check after all of your prep functions.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.