Page 1 of 1

mysql type format question

Posted: Mon May 26, 2008 2:09 am
by Shendemiar
How do i query integer values of varchar field?

Field has '0000111' and i need to query for the integer value of that, aka 111

Re: mysql type format question

Posted: Mon May 26, 2008 2:17 am
by Shendemiar
Got it

Code: Select all

$setelit_q = fetch_query("SELECT * FROM shs_data_setelit WHERE  CAST(sarjanumero AS SIGNED)<='{$_POST['max']}' AND CAST(sarjanumero AS SIGNED)>='{$_POST['min']}' ");