php - MySQL 1064 error for alter table -
this driving me nuts, can't figure out what's wrong.
here query passed in mysqli_query:
alter table `lc_products` add `default_category_id` int(11) not null after `sold_out_status_id`;
this fatal error php throws:
fatal error: 1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'alter table `lc_products` add `default_category_id` int(11) not null after `s' @ line 1
the exact same query works when inserted phpmyadmin.
using xamp windows php 5.4 + mysql 5.5.4.
does know what's going on, or wrong?
$query = "alter table `lc_products` add `default_category_id` int(11) not null after `sold_out_status_id`;"; $result = mysqli_query($link, $query) or $this->_error($query, mysqli_errno($link), mysqli_error($link));
delete semi-colon query.
$query = "alter table `lc_products` add `default_category_id` int(11) not null after `sold_out_status_id`";
Comments
Post a Comment