我试图将两个结果存储在两个变量中,但无法正常工作:
$sql->query('SELECT * FROM table1; SELECT * from table2;');
$first = $sql->getAllData();
$second = $sql->nextRowset()->getAllData();
我应该怎么用呢?
编辑:功能:
public function getAllData()
{
$this->execute();
return $this->stmt->fetchAll(PDO::FETCH_ASSOC);
}