mysql type format question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

mysql type format question

Post 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
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Re: mysql type format question

Post 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']}' ");
Post Reply