wheresrhys
wheresrhys

Reputation: 23560

Set MySQL to return numbers as numbers

Using Codeigniter, any numeric data returned from my MySQL database is returned as strings. How can I configure the database/PHP/Codeigniter to return numbers as numbers?

Upvotes: 0

Views: 105

Answers (1)

Ben Swinburne
Ben Swinburne

Reputation: 26477

This isn't just Codeigniter behaviour, it's the behaviour of PHP generally.

If you look at any of the result functions such as mysql_result() or mysql_fetch_array() to name a couple, they return string or an array of strings respectively.

The Codeigniter MySQL drivers use these functions to return their results.

Upvotes: 4

Related Questions