PHP and MySql using PDO 'String data, right truncated' Error after insert image in PHPMyAdmin -


i pretty new php , mysql , having trouble think longblob column in db. entire error here

fatal error: uncaught exception 'pdoexception' message 'sqlstate[01004]: string data, right truncated' in client.php:110 stack trace: #0 client.php(110): client::findbyownerid() #1 user.php(91): client->findbyownerid('2') #2 usercontroller.php(26): user->findbyid('2') #3 {main} thrown in client.php on line 110 

i seem error if upload image longblob column. if delete row image works great.

i using pdo connect to database, have searched solution have found similar problems not seem mention images...

is sql config issue, missing pdo attribute?

here pdo code

$dbconnstring = "mysql:host=" . db_server . ";port=".db_port."; dbname=" . db_database; $this->dbconnection = new pdo($dbconnstring, db_username, db_password);         $this->dbconnection->setattribute(pdo::attr_emulate_prepares, false); $this->dbconnection->setattribute(pdo::attr_errmode, pdo::errmode_exception);    

i personaly prefer not store images in database if need : check image size if exceeds 1mb have increase max_allowed_packet option in server configuration file. can change in startup variables section in mysql administrator on networking page.

check link

http://dev.mysql.com/doc/refman/5.0/en/program-variables.html


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -