I created a table
and try to create an insert function:Code:CREATE TABLE basket (id INT NOT NULL AUTO_INCREMENT, item VARCHAR(50) NOT NULL, amount VARCHAR(50) NOT NULL);
But when I try to test the operation in Flex Builder I get the following error:Code:public function add_basket_item() { include '../vo/basketVO.php'; $stmt = mysqli_prepare($this->connection, "INSERT INTO basket (item, amount) VALUES (?, ?)"); $this->throwExceptionOnError(); mysqli_stmt_bind_param($stmt, 'ss',$item->item, $item->amount); $this->throwExceptionOnError(); mysqli_stmt_execute($stmt); $this->throwExceptionOnError(); $autoid = mysqli_stmt_insert_id($stmt); mysqli_stmt_free_result($stmt); mysqli_close($this->connection); return $autoid; }
InvocationTargetException:There was an error while invoking the operation. Check your server settings and try invoking the operation again.
Reason: Server error MySQL Error - 1048: Column 'item' cannot be null /../services/DBBase.php on line 26
I have tried various things but just can't get it to work. Any help would be much appreciated.


Reply With Quote

Bookmarks