Php 如何将请求拉入数据库?
你好!请告诉我如何使用3个不同的表提取数据以获取信息 我现在有:Php 如何将请求拉入数据库?,php,mysql,sql,opencart,Php,Mysql,Sql,Opencart,你好!请告诉我如何使用3个不同的表提取数据以获取信息 我现在有: $result = $this->db->query("SELECT * FROM oc_order_product WHERE order_id = (SELECT order_id FROM oc_order_product ORDER BY order_product_id DESC LIMIT 1)"); 及 如何正确添加**$result**oc_产品_选项_值和价格,数量?因为我从未尝试过出错的事情)你为
$result = $this->db->query("SELECT * FROM oc_order_product WHERE order_id = (SELECT order_id FROM oc_order_product ORDER BY order_product_id DESC LIMIT 1)");
及
如何正确添加**$result**oc_产品_选项_值和价格,数量?因为我从未尝试过出错的事情)你为什么不这样做呢?选择*FROM oc\U order\U product 1 order BY order\U product\U id DESC LIMIT 1您到底想要什么如果您想从多个表中获取数据,为什么不使用
联接呢!你为什么不这样做呢?选择*FROM oc\U order\U product 1 order BY order\U product\U id DESC LIMIT 1您到底想要什么如果您想从多个表中获取数据,为什么不使用联接呢!
EOD;
for($i = 0; $i<count($result->rows); $i++) {
$points = $result->rows[$i]['points'];
$price = $result->rows[$i]['price'];
$counts = $result->rows[$i]['quantity'];
$str .= <<<EOD
$price = $result->rows[$i]['price'];
$counts = $result->rows[$i]['quantity'];