Var_dump ($data);
$categoryModel->add ($data);
I started to think that the position type was wrong, but whether it was a string or an int, it was the same as reporting an illegal data object error. $data [' position '] = intval ($footPosition) + 1; This comment is no problem with inserting data. Help me.
Var_dump after the results are as follows, can not see what the problem ah.
Array (7) {["Category_name"]=> string (12) "Rumblings" ["user_id"]=> int (1) ["Create_at"]=> string (19) "2015-04-05 15 : 39:41 "[" Update_at "]=> string ()" 2015-04-05 15:39:41 "[" Is_enable "]=> int (1) [" is_visible "]=> int (1) [" Position "]=> int (2)}
The database field position, determined not to contain spaces, and the column names are consistent.
------to solve the idea----------------------
$footPosition = $categoryModel->getfootposition ();
And then print out $footPosition see what it is
In addition, the original error message should be given when an error occurs
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.