我正在將我的php/mySQL代碼轉換爲使用預準備語句。 我可以看到準備SQL或DML和綁定參數的值(安全等)。但我的查詢按名稱指定了選擇列表中的字段,並使用關聯數組來訪問它們。mysqli_stmt_bind_result的優點是什麼?
或者,在這樣的一個地方,我不得不做出的結果數組中的索引的假設情況下幫助?
$listquery = "SELECT {$tables["result"]}.time, " .
" HOUR({$tables["result"]}.time), " . // [1]
" MINUTE({$tables["result"]}.time), " . // [2]
" SECOND({$tables["result"]}.time), " . // [3]
" {$tables["rider"]}.id, {$tables["rider"]}.gender, " .
" {$tables["rider"]}.first, {$tables["rider"]}.last, " .
" {$tables["result"]}.dnf, " .
" {$tables["race"]}.courseid " .
" FROM {$tables["race"]}, {$tables["result"]}, {$tables["rider"]} " .
" WHERE {$tables["race"]}.raceid = {$tables["result"]}.raceid " .
" AND {$tables["result"]}.riderid = {$tables["rider"]}.id" .
" AND {$tables["race"]}.raceid = ? " .
" ORDER BY {$tables["result"]}.dnf, {$tables["result"]}.time ASC ";
我會更開心,如果這個問題有一個像'verifiable','meaningful','conceptual'減少像答案的可能性_some_預選賽「在這種特殊情況下bind_result爲0.000000345±1.2納秒我更快(不進一步指定)machine「;-) – VolkerK