【发布时间】:2010-11-21 20:20:36
【问题描述】:
如何在 Postgres 中通过 PHP 编译整数数据?
我的整数是字符串,如下所示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
我通过以下代码编译值,这显然是pg_prepare 和pg_execute 之后的问题根源。
while ( $row = pg_fetch_array( $result ) ) {
$user_id = $row['user_id'];
}
【问题讨论】:
标签: php string postgresql types integer