Jump to content

[SOLVED] sql query


pacome

Recommended Posts

Hi!

 

Let's say I've retrieved some data from a DB...

I've got two different prices: $currentprice and $previousprice..

 

I would like to work out which have the highest increase in price from my list...

I managed to work out porcentages by doing something like:

 

$evolution = ($row[currentprice]-$row[previousprice])/$row[previousprice]*100;

 

but I would like to select the top 10 highest increases for example...

 

Can you do that?

 

Thank you very much!

Link to comment
https://forums.phpfreaks.com/topic/54796-solved-sql-query/
Share on other sites

right!

 

I tried that... I don't know what the name of the new variable will be... I tried $difference it's ok!! great!

 

do you know how to find out what are the name of the original variables that selected?

 

The DB has the following:

 

id, players, previousprice, currentprice and nickplayer...

 

you see I need to show the name of the top 5 players that have increased it's price the highest...

 

Thank you for your help!

Link to comment
https://forums.phpfreaks.com/topic/54796-solved-sql-query/#findComment-271014
Share on other sites

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.