mysqli and field types

Posted by Mikk on Stack Overflow See other posts from Stack Overflow or by Mikk
Published on 2010-06-10T02:28:23Z Indexed on 2010/06/10 2:32 UTC
Read the original article Hit count: 259

Filed under:
|
|
|
|

Hi,

I'd like to know if there is a simple way to fetch data from mysql tables with "correct" data types? What i mean, if field type is for example INT or SMALLINT is it possible to pass those types directly to PHP as integers?

I did some searching and found mysqli_fetch_fields, but for SMALLIT type is 2, for INT 3 and so on. It could be done that way, but it looks rather clumsy workaround. Is there any better way?

I'm using PHP and mysqli.

Thank you.

© Stack Overflow or respective owner

Related posts about php

Related posts about beginner