I'm migrating my PHP codes from mysql
(deprecated in 5.5) to PDO_MySQL
. However, mysql_fetch_row
returns integer while PDOStatement::fetch
returns strings for numbers. How can I make PDO behaves like the former one?
Result of mysql_fetch_row
:
array(1) {
["id"]=>
int(1)
}
Result of PDOStatement::fetch
:
array(1) {
["id"]=>
string(1) "1"
}
See Question&Answers more detail:os