Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将请求拉入数据库?_Php_Mysql_Sql_Opencart - Fatal编程技术网

Php 如何将请求拉入数据库?

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_产品_选项_值和价格,数量?因为我从未尝试过出错的事情)你为

你好!请告诉我如何使用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_产品_选项_值价格数量?因为我从未尝试过出错的事情)

你为什么不这样做呢?选择*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'];