Jump to content

Getting selective data from mysql and ordering it in a table!


Freid001

Recommended Posts

Ok I was wondering is there a way I can select a mysql database, and order it but only show data of a certain criteria: for example

 

Mysql database:

ID | User | XP | Won | Lost

1    Freid  100  1        4

2    Smic  300  5        4

3    Retna 300  3        2

4    OBW  200  3        2

 

And then some php code that will retrieve this information but only display the users that have lost = 4 in a list. In other words some php code that will only list the players Freid and Smic from the msql database becuase they have Lost = 4 the code would not show Retna or OBW becuase there Lost is not = to 4

 

Any help would be great thanks

 

Freid001

Databases wouldn't be very useful if you couldn't provide criteria to them and get back result sets.  Fire up your mysql command line or phpMyAdmin and do some queries so you can understand the process.  I don't know what your table name is, so I called it usersummary in this example:

 

SELECT * from usersummary WHERE Lost = 4 ORDER BY XP

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.