Welcome Guest, Not a member yet? Register   Sign In
Get data in type from DB
#2

MySQL will return most things as a string since each programming language has a different set of primitive types.

If you're using Entities, you can cast the column to an int as described in the user guide.

If you're not using entities, you'll have to do that yourself. You can always check with is_numeric, but PHP will automatically typecast from string to int if needed.
Reply


Messages In This Thread
Get data in type from DB - by motoroller - 01-26-2023, 01:27 PM
RE: Get data in type from DB - by kilishan - 01-26-2023, 03:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB