This has got to have an extremely simple answer but I have amazingly never come across this problem before until now.
I have an array which contains products and prices.
Product 1 - 3.50
Product 2 - 19.30
Product 3 - 7.25
When I order the array by price ascending (ORDER BY price ASC) it SHOULD obviously be:
Product 1 - 3.50
Product 3 - 7.25
Product 2 - 19.30
However, it brings up the results as:
Product 2 - 19.30
Product 1 - 3.50
Product 3 - 7.25
It seems to only take into account the first integer of each price and orders the array based on that.
Why? Have I really gone so many years doing PHP to have never ordered an array by integers of different lengths before?
Am I missing something really, really obvious? I must be! But I don't even know what to try and look for in Google, which is why I am here.
Thank you to anyone who can help me with this embarrassing problem.