Jump to content


Photo

query help


  • Please log in to reply
1 reply to this topic

#1 Silverslide

Silverslide
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 20 April 2006 - 08:10 PM

I want the query to only select the item with id 1 till 10
how do i do that
SELECT * FROM news WHERE id='....' ?

please help me

#2 sanfly

sanfly
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationNew Zealand

Posted 20 April 2006 - 08:22 PM

[!--quoteo(post=366986:date=Apr 21 2006, 08:10 AM:name=Silverslide)--][div class=\'quotetop\']QUOTE(Silverslide @ Apr 21 2006, 08:10 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I want the query to only select the item with id 1 till 10
how do i do that
SELECT * FROM news WHERE id='....' ?

please help me
[/quote]


Maybe...

SELECT * FROM news WHERE id >= '1' AND id <= '10'

or to make it more dynamic

$min = 1;
$max = 10;

SELECT * FROM news WHERE id >= '$min' AND id <= '$max'
If you're not part of the solution, you're part of the precipitate




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users