1
그래서 내 prepared statement
에서 오류를 발견,이 내가지고있어 전체 오류입니다 : 여기 치명적인 오류 : catch되지 않은 예외 '예외'
Fatal error: Uncaught exception 'Exception' with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= ?' at line 1' in C:\xampp\htdocs\w-classes\class.functions.php:82 Stack trace: #0 C:\xampp\htdocs\index.php(12): Functions->getSiteSetting('language') #1 {main} thrown in C:\xampp\htdocs\w-classes\class.functions.php on line 82
가 일부 코드,하지만 난 오류가 표시되지 않습니다 . 또한 구체적으로 모든 데이터베이스 행과 테이블이 있는지 확인했습니다.
class.functions.php (94 라인 79)
public function getSiteSetting($setting) {
$stmt = $this->mysqli->prepare('SELECT value FROM ' . $this->prefixed('settings') . 'WHERE name = ?');
if(!$stmt) {
throw new Exception($this->mysqli->error, 1);
}
$stmt->bind_param('s', $setting);
$stmt->execute();
$stmt->bind_result($result);
$stmt->store_result();
if($stmt->num_rows > 0) {
while ($stmt->fetch()) {
return $result;
}
}
$stmt->close();
}
의 index.php (15 9 호선)
define('WCREATE_BASE', dirname(__FILE__));
include_once(WCREATE_BASE . '/w-core.php');
include_once(WCREATE_BASE . '/w-languages/lang.' . $functions->getSiteSetting('language') . '.php');
if(!existingTable($db->prefixed('settings'))) {
displayErrors('no_table', array('table' => $db->prefixed('settings')));
}
당신은 아무것도 볼 수 있습니까?