So a successful mysqli_query()
returns true if there is no data and it returns a mysqli_result
object if there is data(ie the query was a SELECT
, SHOW
, DESCRIBE
or EXPLAIN
).
But with a successful pg_query()
it always returns the samething(a query result resource) regardless of whether or not there's any data coming back.
Can I use the pg_query()
return value to determine if the query was either SELECT
, SHOW
, DESCRIBE
or EXPLAIN
like I can do with mysqli_query()
?
there is no full proof way to determine 'select' vs 'insert / update' from pg extension functions. two function can be used but work only if some rows are returned or affected by the sql.