Skip navigation links

MySQL Forums :: PHP :: Reason: Server error MySQL Error - 1048: Column 'item' cannot be null


Advanced Search

Reason: Server error MySQL Error - 1048: Column 'item' cannot be null
Posted by: davey Stokhof ()
Date: November 12, 2012 01:50AM

Hi Guys,

I am working with Flex builder, and am making a mobile application with PHP and an sql database.

I have an error showing up when I try to test the following 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;
}



error:
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 /Applications/MAMP/htdocs/MenuPlannerApp/services/DBBase.php on line 26


Any help would be much appreciated

Options: ReplyQuote


Subject Written By Posted
Reason: Server error MySQL Error - 1048: Column 'item' cannot be null davey Stokhof 11/12/2012 01:50AM
Re: Reason: Server error MySQL Error - 1048: Column 'item' cannot be null Rick James 11/13/2012 07:52PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.