Hello guys, is there any way to display variables from highest to lowest without storing them into an array? For example i got multiple variables $numone = 500; $numtwo = 600; $ numthree = 700; and i want to display it out base on their value.

Any help is much appreciated

Member Avatar for LastMitch

@scholarwithfire

Display variables from highest to lowest without array

Do you have a database? If so you can used a database to get the variable without an array.

Read this tutorial on how to get the highest to the lowest number from the database:

http://www.plus2net.com/sql_tutorial/sql_max.php

@LastMitch

Sorry the variables are not taken directly from database. They are calculations using the data from the database. Is there anyway to display them from highest to lowest without array?

Member Avatar for LastMitch

@scholarwithfire

Sorry the variables are not taken directly from database. They are calculations using the data from the database. Is there anyway to display them from highest to lowest without array?

You didn't explain it well from your top thread. Explain more about calculations? highest to lowest?

Base on what you mention you need to get the data from the table, calculating the data using php and update the table? Am I correct?

Then you still need a query in order to do that.

Do you have a query that pull the data?

Without a query there's no purpose having this thread if you don't have a query to get the data from the table?

If you have a code for this post it.

Why don't you want to use an array?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.