SELECTでmulti_queryを使用していたとき、次のようになりました。
$sql = 'SELECT....';
$sql .= 'SELECT....';
...
if ($db->multi_query($sql))
{
do
{
if ($stmt = $db->store_result())
{
while ($row = $stmt->fetch_assoc())
{
foreach ($row as $key => $value)
{
$var[$key] = $value;
}
}
$stmt->free_result();
}
} while ($db->more_results() && $db->next_result());
}
しかし、結果がないため、DELETEまたはUPDATEのみが必要な場合はどのように表示されますか?
$sql = 'DELETE...';
$sql .= 'DELETE...';
$sql .= 'UPDATE...';
if ($db->multi_query($sql))
{
do
{
/*well.. nothing?*/
}
while ($db->more_results() && $db->next_result());
}
がなくても機能するようですdo {...}
が、より良い/クリーンなソリューションはありませんか?