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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.