Hello, I've written a very basic shopping cart script in php/mysql for a friend, and I want to be able to sort by price ascending and descending, but if there is a price that is, say $123, it is being sorted as less than, say, $99, because the 1 obviously IS less than the 9. How would I go about making the script know that a 1 in a 3 digit string actually is greater than a 9 in a 2 digit string, and so on? Heres my code: [code] <?php $sort = $_GET['sort']; $by = $_GET['by']; if(!$sort){ $sort = title; } if(!$by){ $by = ASC; } $query2 = mysql_query("SELECT * FROM products WHERE type = 'sfx' ORDER BY $sort $by") or die(mysql_error()); ?><div align="right"> <form name="form1" id="form1">Sort Items By: <select name="menu1" onchange="MM_jumpMenu('parent',this,0)"> <option value="#">[Select One]</option> <option value="index.php?p=sfx&sort=price&by=DESC">Price (High - Low)</option> <option value="index.php?p=sfx&sort=price&by=ASC">Price (Low - High)</option> <option value="index.php?p=sfx&sort=title&by=ASC">Title (A - Z)</option> <option value="index.php?p=sfx&sort=title&by=DESC">Title (Z - A)</option> <option value="index.php?p=sfx&sort=type&by=ASC">Type (A - Z)</option> <option value="index.php?p=sfx&sort=type&by=DESC">Type (Z - A)</option> </select> </form> </div> [/code]