php - MySQL insert & Update query gives error while inserting large data -



php - MySQL insert & Update query gives error while inserting large data -

table structure:

id int(11)

bcontent longtext

when run insert query through php if info going store in bcontent little (2-3 lines paragraph) query runs when size of info increases (10-11 lines paragraph) query gives error. there problem longtext info type? tried longblob no change.

php code:

include("conn.php"); $bcontent = $_post['bcontent']; $query = mysql_query("insert blocks (bcontent) values ('$bcontent')"); if($query) { //success message } else { //error message }

when size of bcontent big php throws //error message.

i increment size of post_max_size 200m in php.ini no change.

error:

you have error in sql syntax; check manual corresponds mysql server version right syntax use

actually gives me output coded in else condition

is there error query or in table structure? please help me.

your content contains quote characters, need escape.

$bcontent = mysql_real_escape_string($_post['bcontent']);

php mysql

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -