I would like to know if there is an easy way to get data from mysql tables with the "correct" data types? What do I mean if a field type, for example, INT or SMALLINT, can I pass these types directly to PHP as integers?
I searched a bit and found mysqli_fetch_fields, but for SMALLIT type 2, for INT 3 and so on. It can be done this way, but it looks rather awkward. Is there a better way?
I am using PHP and mysqli.
Thank.
source
share