Hello i'm struggling with using variables that I declared into my jquery request:
var int_example = "42";
int_example = parseInt(id);
var string_example = "42";
const { Client } = require('pg')
const client = new Client({
user: 'postgres',
host: 'localhost',
database: 'postgres',
password: 'password',
port: 5432
});
var query = "INSERT INTO data (int,string) VALUES (int_example,string_example);
client.connect()
.then(() => console.log("Connection a la base de données réussie"))
.then(() => console.log("Nos commandes:"))
.catch(e => console.log(e))
.then(() => client.query(query))
I get this kind of error : "{ error: column "int_example" does not exist" and i'm not sure if the string_example works as well... Seems I can't use type var or i'm doing something wrong please tell me.
Thank you