MySQL - Select only INT

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

MySQL - Select only INT

Post by oscardog »

Hello,

I have a table with a field 'startletter' which is the first letter of the title which is also in the table. Anyway I can't work out how to select only fields that have an integer in them, i've googled etc but no luck.

Anyone know?

Thanks,

Oscardog
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: MySQL - Select only INT

Post by daedalus__ »

what?

why do you need a whole column for the first letter and you are trying to select only integers from a char type column?

http://stackoverflow.com/questions/1611 ... sql-server

humm..
nga
Forum Commoner
Posts: 46
Joined: Mon Aug 17, 2009 3:05 am

Re: MySQL - Select only INT

Post by nga »

i have no idea what's your idea is for (probably mislead and illogical). But you can use is_numeric() on the field to check if it's numeric and do something only if it is (using if statement)
Post Reply