Jump to content

Select integer values only from a Varchar Field


mjahkoh

Recommended Posts

I'm not sure if there's a way to query it such a way to do that....but

if you just take the data out as is...

 

you can strip the letters out like this (If of course, there are ONLY letter and numbers)

 

$numbers = (int)implode(preg_split("/[^A-Za-z]/", $mysqlRow, -1, PREG_SPLIT_NO_EMPTY);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.