• 16-08-2024, 15:25:48
    #1
    Merhaba bir hata alıyorum ve sorunu çözemedim yardımcı olabilir misiniz?

     case 'POST':
                if ($table === 'deneme') {
                    $sql = "INSERT INTO deneme (studentID, gecenSeneBolumeYerlestiMi, diplomaNotu, toplamNetTYT, toplamNetAYT, aytHamPuanSiralama, tytHamPuanSiralama, tytYerlestirmePuaniSiralama, aytYerlestirmePuaniSiralama, aytHamPuan, aytYerlestirmePuani, tytHamPuan, tytYerlestirmePuani, tur)
                            VALUES (:studentID, :gecenSeneBolumeYerlestiMi, :diplomaNotu, :toplamNetTYT, :toplamNetAYT, :aytHamPuanSiralama, :tytHamPuanSiralama, :tytYerlestirmePuaniSiralama, :aytYerlestirmePuaniSiralama, :aytHamPuan, :aytYerlestirmePuani, :tytHamPuan, :tytYerlestirmePuani, :tur)";
                        // PDO hazırlığı
                        $stmt = $pdo->prepare($sql);
                        // Parametreleri tanımlama
                        $params = [
                        ':studentID' => $student_id,
                        ':gecenSeneBolumeYerlestiMi' => $gecenSeneBolumeYerlestiMi,
                        ':diplomaNotu' => $diplomaNotu,
                        ':toplamNetTYT' => $toplamNetTYT,
                        ':toplamNetAYT' => $toplamNetAYT,
                        ':aytHamPuanSiralama' => $aytHamPuanSiralama,
                        ':tytHamPuanSiralama' => $tytHamPuanSiralama,
                        ':tytYerlestirmePuaniSiralama' => $tytYerlestirmePuaniSiralama,
                        ':aytYerlestirmePuaniSiralama' => $aytYerlestirmePuaniSiralama,
                        ':aytHamPuan' => $aytHamPuan,
                        ':aytYerlestirmePuani' => $aytYerlestirmePuani,
                        ':tytHamPuan' => $tytHamPuan,
                        ':tytYerlestirmePuani' => $tytYerlestirmePuani,
                        ':tur' => $tur
                                    ];
                        // Sorguyu çalıştırma
                        $stmt->execute($params);
                        var_dump($stmt->errorInfo());
                        var_dump($params);
    Hata

    {
        "status": false,
        "message": "Veritabanı hatası: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined",
        "errorCode": "DB_ERROR",
        "data": null
    }
  • 16-08-2024, 15:37:21
    #2
    $sql = "INSERT INTO deneme (studentID, gecenSeneBolumeYerlestiMi, diplomaNotu, toplamNetTYT, toplamNetAYT, aytHamPuanSiralama, tytHamPuanSiralama, tytYerlestirmePuaniSiralama, aytYerlestirmePuaniSiralama, aytHamPuan, aytYerlestirmePuani, tytHamPuan, tytYerlestirmePuani, tur)
            VALUES (:studentID, :gecenSeneBolumeYerlestiMi, :diplomaNotu, :toplamNetTYT, :toplamNetAYT, :aytHamPuanSiralama, :tytHamPuanSiralama, :tytYerlestirmePuaniSiralama, :aytYerlestirmePuaniSiralama, :aytHamPuan, :aytYerlestirmePuani, :tytHamPuan, :tytYerlestirmePuani, :tur)";
    
    $params = [
        ':studentID' => $student_id,
        ':gecenSeneBolumeYerlestiMi' => $gecenSeneBolumeYerlestiMi,
        ':diplomaNotu' => $diplomaNotu,
        ':toplamNetTYT' => $toplamNetTYT,
        ':toplamNetAYT' => $toplamNetAYT,
        ':aytHamPuanSiralama' => $aytHamPuanSiralama,
        ':tytHamPuanSiralama' => $tytHamPuanSiralama,
        ':tytYerlestirmePuaniSiralama' => $tytYerlestirmePuaniSiralama,
        ':aytYerlestirmePuaniSiralama' => $aytYerlestirmePuaniSiralama,
        ':aytHamPuan' => $aytHamPuan,
        ':aytYerlestirmePuani' => $aytYerlestirmePuani,
        ':tytHamPuan' => $tytHamPuan,
        ':tytYerlestirmePuani' => $tytYerlestirmePuani,
        ':tur' => $tur
    ];
  • 16-08-2024, 16:37:33
    #3
    MEG adlı üyeden alıntı: mesajı görüntüle
    $sql = "INSERT INTO deneme (studentID, gecenSeneBolumeYerlestiMi, diplomaNotu, toplamNetTYT, toplamNetAYT, aytHamPuanSiralama, tytHamPuanSiralama, tytYerlestirmePuaniSiralama, aytYerlestirmePuaniSiralama, aytHamPuan, aytYerlestirmePuani, tytHamPuan, tytYerlestirmePuani, tur)
            VALUES (:studentID, :gecenSeneBolumeYerlestiMi, :diplomaNotu, :toplamNetTYT, :toplamNetAYT, :aytHamPuanSiralama, :tytHamPuanSiralama, :tytYerlestirmePuaniSiralama, :aytYerlestirmePuaniSiralama, :aytHamPuan, :aytYerlestirmePuani, :tytHamPuan, :tytYerlestirmePuani, :tur)";
    
    $params = [
        ':studentID' => $student_id,
        ':gecenSeneBolumeYerlestiMi' => $gecenSeneBolumeYerlestiMi,
        ':diplomaNotu' => $diplomaNotu,
        ':toplamNetTYT' => $toplamNetTYT,
        ':toplamNetAYT' => $toplamNetAYT,
        ':aytHamPuanSiralama' => $aytHamPuanSiralama,
        ':tytHamPuanSiralama' => $tytHamPuanSiralama,
        ':tytYerlestirmePuaniSiralama' => $tytYerlestirmePuaniSiralama,
        ':aytYerlestirmePuaniSiralama' => $aytYerlestirmePuaniSiralama,
        ':aytHamPuan' => $aytHamPuan,
        ':aytYerlestirmePuani' => $aytYerlestirmePuani,
        ':tytHamPuan' => $tytHamPuan,
        ':tytYerlestirmePuani' => $tytYerlestirmePuani,
        ':tur' => $tur
    ];
    teşekkür ederim