How can you check if a resource is false in PHP pg request parameters ?
I run the following code unsuccessfully
$row = pg_num_rows ( $result );
if ( $row !== 0 )
echo "hurray";
else
echo "argh";
He gives me the following warnings
Warning: pg_query_params() [function.pg-query-params]: Query failed: ERROR: invalid input syntax for integer: "" in /var/www/codes/index.php on line 120
I use $dbconnwhat is right, so the second warning seems like only a symptom. The reason for this is an invalid integer type.
My request is
$dbconn = pg_connect("host=localhost port=5432 dbname=masi user=masi password=123");
$result = pg_query_params ( $dbconn,
'SELECT question_id
FROM questions
WHERE question_id = $1',
array ( $question_id )
);
source
share