Home > Net >  Grabbing from defined number of users using php mysql
Grabbing from defined number of users using php mysql

Time:03-18

I'm try to grab data on a certain amount of users in game and I was hoping this would work:

$query= "SELECT * FROM users WHERE userid='7906' TO '8055'"; 

I only want to grab data from userid 7906 up to userid 8055. How can I do this?

CodePudding user response:

You can check with operator as well:

$query= "SELECT * FROM users WHERE userid >='7906' AND userid <= '8055'"; 

CodePudding user response:

Use BETWEEN Operator:

$query = "SELECT * FROM users WHERE userid BETWEEN 7906 AND 8055";
  • Related