I have this mySQL Query
SELECT list.*, brand.displayed_text AS brandName
FROM itemmaster_list AS list
LEFT JOIN brand_lists AS brand ON brand.cid = list.brandcode
WHERE brandcode = 'abc'
ORDER BY list.orderpriority DESC, list.date_added DESC , list.cid DESC
When you run this in PHPMySQL it returns data CORRECTLY sorted by the field [list.orderpriority]
but when you run it in my php code (thru browser) it sorts data by the field [list.date_added]
PHP Code
$result_item = mysql_query("SELECT list.*, brand.displayed_text AS brandName FROM itemmaster_list
AS list LEFT JOIN brand_lists AS brand ON brand.cid = list.brandcode WHERE brandcode = 'abc'
ORDER BY list.orderpriority DESC, list.date_added DESC , list.cid DESC") or die(mysql_error());
if (mysql_num_rows($result_item) > 0) {
while($row_item = mysql_fetch_array($result_item)) {
[echo here the records]
}
}