davy_yg
151
8
General

PHP Query

Posted 7 months ago by davy_yg

Hello,

This is PHP.

Help me understand this code:

if($selectDB == true){
    $query = "INSERT INTO recruitment 
            (ID, nama, jenis_kelamin, tanggal_lahir, nohp, email, alamat, provinsi, kota, zip, status_nikah, jumlah_tanggungan, agama, file_attachment, cover_letter)
          VALUES (NULL, '$nama', '$jenis_kelamin', '$tanggal_lahir', '$nohp', '$email', '$alamat', '$provinsi', '$kota', '$zip', '$status_nikah','$jumlah_tanggungan','$agama','$file_attachment', '$cover_letter');";

        // "INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
        // VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');";


    $simpan = mysqli_query($connect, $query);
    echo "save - ".$simpan;

    if(!$simpan){
        echo 'failed';
    }else{
            echo 'success';
    }
}

I wonder why $simpan = '' ?

1simpan - failed?

What did I do wrong?

Please sign in or create an account to participate in this conversation.