How do you compile integer data in Postgres by PHP?
My integers are string as the following show by var_dump ( $_SESSION )
'logged_in' => int 1
'user_id' => string '9' (length=1) // should be int
'a_moderator' => string '0' (length=1) // should be int
I compile the values by the following code which obviously is the source of the problem after pg_prepare
and pg_execute
.
while ( $row = pg_fetch_array( $result ) ) {
$user_id = $row['user_id'];
}