Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in rota16lojistik.com/trex/index.php:6 Stack trace: #0 /trex/index.php(6): PDOStatement->execute() #1 {main} thrown in /trex/index.php on line
<?php
ob_start();
session_start();
date_default_timezone_set('Europe/Istanbul');
[B]SATIR 6 - > include 'trex/controller/config.php';[B]6
[/B]
// Genel site ayarlarını veritabanından çekme
try {
$query = $db->prepare("SELECT * FROM ayar WHERE ayar_id = :id");
$query->execute([':id' => 0]); // Parametre olarak 0 gönderiyoruz
$settingsprint = $query->fetch(PDO::FETCH_ASSOC);
if (!$settingsprint) {
throw new Exception("Ayarlar bulunamadı."); // Ayarların bulunamaması durumunda hata fırlatıyoruz
}
} catch (PDOException $e) {
echo "Ayarlar yüklenemedi: " . $e->getMessage(); // Hata mesajını gösteriyoruz
echo "<br>Sorgu: " . $query->queryString; // Hangi sorgunun çalıştığını gösteriyoruz
} catch (Exception $e) {
echo $e->getMessage();
} [/B]