PHP Query

Posted 3 months ago by davy_yg


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;

        echo 'failed';
            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.

Reply to

Use Markdown with GitHub-flavored code blocks.