Home » Php » Why do you need a specific syntax to insert data into postgresql

Why do you need a specific syntax to insert data into postgresql

Posted by: admin October 29, 2018 Leave a comment

Questions:

I have found a way to insert data into a postgresql database using php. Therefore, I used the following syntax:

$sql = "INSERT INTO genes 
        (id,gene,plasmid,accessionnumber,plasmidname) 
        VALUES ('".$var_id."','".$var_gene."','".$var_ACC."','".$var_PN."')";

For some reason, this the only way it works. Why do I need to add the point and why do I need double and single brackets and not just the single brackets?

Answers: