0
我目前使用下面的代碼片段搜索雖然DB庫MySQLi:尋找
for($i=0; $i<sizeof($deleted_records);$i++) {
if($stmt->prepare("SELECT `id`, `status` FROM `02-2012` WHERE `id` = ?")) {
// Bind your variable to replace the ?
$stmt->bind_param('s', $id);
// Set your variable
$id = $deleted_records[$i];
// Execute query
$stmt->execute();
// Bind your result columns to variables
$stmt->bind_result($id_f, $stat_f);
// Fetch the result of the query
while($stmt->fetch()) {
//echo $id_f . ' - ' . $stat_f . '<div>';
array_push($hits, $id_f);
}
}
其中
$deleted_records
是在一個MySQL表數組的元素大陣列(基本上試圖在'02 -2012'表中找到陣列元素的所有出現)
T他用這種方法的問題是,它現在速度很慢。我確信有比這種強力方法更好/更優雅的方式。
感謝您的時間