An error occurred while submitting data to mysql in php.
$sql = "insert into ecs_goods(cat_id,goods_sn,goods_name,goods_name_style,goods_number,market_price,shop_price,warn_number,goods_desc,is_real,is_on_sale,is_alone_sale,add_time,sort_order,is_new,give_integral,rank_integral,goods_type) values ('".$goods_type."','".$goods_sn."','".$goods_name."',"."'+'".",9999,".$shop_price.",".$shop_price.",1,\"".$str2."\",1,1,1,'".time()."',100,0,-1,-1,". $goods_type_type .")";
The $ str2 variable contains about characters. other data is normal when it is submitted, but the data submitted for this variable is only a short section above, but it is strange that, I used the same SQL statement in phpmyadmin to include all the variables for execution, but the execution was successful ..
Reply to discussion (solution)
Is there a limit on the length of database fields?
What should I modify if there are limits?
Is there a limit on the length of database fields?
What should I modify if there are limits?
What is the SQL statement executed by phpmyadmin?
In addition, what type is your field.
What is the SQL statement executed by phpmyadmin?
In addition, what type is your field.
Text
I used echo to output the $ SQL statement executed by phpmyadmin and then submitted it.
Create a stored procedure and insert 2 W characters of data at a time. What makes PHP feel like!
Too abnormal !~ @~~~
Sit wait
The name of a field is 2 W characters, which is unknown.
It is best to post mysql errors for analysis.
Mysql_query ($ SQL) or die (mysql_error ());
I have never had such a large field, so I am not sure
Modify max_allowed_packet = 8 M in the mysql configuration file (my. ini ).
Isn't the encoding set?
Solved it by yourself. modified the data storage format.