问题
This didn't return any helpful google results, so I'll just ask it here:
Is it possible in PHP to start another query inside another query's fetch statement after executing() the first query?
e.g.
if ($stmt=mysqli->prepare(query)) {
$stmt->bind_param('s', $variable);
$stmt->execute();
$stmt->store_result();
while ($stmt->fetch()) {
if ($stmt2=mysqli->prepare(query2)) {
$stmt2->bind_param('s', $othervariable);
$stmt2->execute();
$stmt2->store_result();
while ($stmt2->fetch()) {
store result or something
}
}
}
}
来源:https://stackoverflow.com/questions/18136762/php-sql-query-inside-another-querys-fetch-statement