Hello;
I am working on a MySQL database table for baseball game scores.
Does anybody know why I need to use one of the integer column types to store numbers?
If I do a SELECT clause and apply the gettype() function to numbers extracted from an integer column types they come out as type “string” - not type “integer.”
I am trying to get an integer column to have a default value of empty. However, the table automatically inserts a “0” in an empty column. It displays on the page as a “0” when there should be a blank space there (before the games are played it needs to be an empty space since there’s not yet a score).
If I use a varchar column type it will default to an empty cell. If I extract the number from the varchar column type using a select function is also comes out as type “string.”
Basically, varchar does what I need with a number. The integer column type does not.
I am trying to figure out if I use varchar column types for the numerical scores, instead of the integer type, will it cause problems later on?
I would appreciate any information that someone might have.
Thanks.