I have a newbie question. I am trying to add additional items to the below php file. item_name
is working fine and inserts correctly. I added order as another entry, but I get a false success with the below code. It say data entered successfully, but the database does not update. Can someone take a look and point out where my mistake is?
<?php
error_reporting(0);
include("db_config.php");
// array for JSON response
$response = array();
if( !(empty($_POST['item_name'])))
if( !(empty($_POST['order'])))
{
$item_name=$_POST['item_name'];
$order=$_POST['order'];
$result = mysql_query("INSERT INTO myorder(id,item,order) VALUES('','$item_name','$order')");
if($result>0){
$response["success"] = 1;
}
else{
$response["success"] = 0;
}
// echoing JSON response
echo json_encode($response);
}
?>