I'm using nodejs 0.10.12 and the pg module, version 2.2.0.
Now, on the server side I have a code like
var ja=message.utf8Data;
var query = client.query("SELECT pins.p_name FROM pins WHERE p_id = ja");
ja is a var, representing an int,came from the client side, through websockets. I'm trying to use it to the query but I can not. I can not find the right syntax to make it work. The query and the code in general work fine, if I replace ja in the query with , for example, 64.
I tried syntax like p_id=(ja) but I keep getting errors like undefiend or ja is not a column in a table.
What is the rigth syntax?
Thanks