Jump to content

Recommended Posts

I have a database containing products, each has a price.

i want to be able to sort the database by price, high to low or low to high.


$query = "SELECT * FROM $table order by price asc LIMIT $limitvalue, $limit";

$limitvalue and $limit are pagination variables which work okay

the table gets sorted by price okay but i get:

1.50
17.00
19.50
2.00
22.00
234.00
3.19

you can see whats happening, wbut why? and how can i fix it display the correct ascending order.
blimey, simple as that eh?

i've been waving my fist at the computer Basil Fawlty style...and swearing..

well, its a good job you is a moderators and i aint.

cheers buddy.

edit: Just tried it, it worked....prob resolved!
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.