mysqi_multi_query返回空

时间:2017-05-01 17:09:55

标签: php mysql mysqli-multi-query

我希望使用mysqli_multi_query在单个查询中执行插入和选择,但$ res为空...

$sql= "INSERT INTO selection_anonyme (date, journal, section) VALUES ($date, $name, $section);";

$sql .= "SELECT tbl.* FROM (SELECT date, section, title, teaser, href, image FROM scrap WHERE (journal = '$journal' AND section = '$section') ORDER BY date DESC LIMIT 15) as tbl GROUP BY tbl.title";

$dbc->multi_query($sql);
$res = $dbc->store_result();
var_dump($res);

我明白了:bool(假)

$ dbc是我的连接,它适用于单个查询。我想知道如何使$ res工作以及对象包含什么(只有select的结果?)

0 个答案:

没有答案