I'm creating a PHP application which relies on PostgreSQL. Now I have this query:
$query= 'INSERT INTO "users" ("name", "username", "email", "phone") VALUES (\''. $name .'\', \''. $username .'\', \''. $email.'\', '. $phone .')';
$name values can be null.
When I run this query, I get a syntax error.
So my question is: to insert a null value, I have to manually write null or am I missing something in the query?
Seems like I am forced to write null as value.