Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   to select range of id from table (http://www.go4expert.com/forums/select-range-id-table-t5376/)

kalaid 21Jul2007 16:25

to select range of id from table
 
Hi,
how do you choose a range of ID from a db?

I used query to select record matched with particular id
$data = mysql_query("SELECT * FROM table_name WHERE (id=2)")

I tried like above query to select record with id's 2 through 9
$data = mysql_query("SELECT * FROM table_name WHERE (1<id<9)")

it didnt work. Help me

shabbir 21Jul2007 19:45

Re: to select range of id from table
 
Use the between keyword.


All times are GMT +5.5. The time now is 13:53.