我遇到了php,mysql和json的问题
我无法通过选择两个条件从数据库中检索数据
我也附上了screenshot
我想通过考虑两个条件来检索表customer_stock
中的数量:客户和名称
$line = $db->queryUniqueObject("SELECT * FROM stock_details WHERE stock_name ='" . $_POST['stock_name1'] . "'");
$cost = $line->company_price;
$sell = $line->selling_price;
$stock_id = $line->stock_id;
$line = $db->queryUniqueObject("SELECT * FROM customer_stock WHERE name='" . $_POST['stock_name1'] . "'");
$stock = $line->quantity;
if ($line != NULL) {
$arr = array("cost" => "$cost", "sell" => "$sell", "stock" => "$stock", "guid" => $stock_id);
echo json_encode($arr);
} else {
$arr1 = array("no" => "no");
echo json_encode($arr1);
}