问题
I have a SQL SELECT in which I aliased MIN(A.product_id + 1) to 'min':
$product='SELECT * FROM '.$table.' WHERE product_id > '.(($div_id)*10000).' AND product_id < '.((($div_id+1)*10000)-1).'';
$select='SELECT MIN(A.product_id + 1) AS min FROM ('.$product.') A LEFT JOIN ('.$product.') B
ON A.product_id = B.product_id - 1
WHERE B.product_id Is NULL';
this is the result in phpMyAdmin:

But in php I have 'min' => NULL
$result = mysql_query($select, $con);
$row=mysql_fetch_assoc($result);
echo $row['min'];
does not show anything!
来源:https://stackoverflow.com/questions/11267623/after-aliasing-sql-field-on-select-i-can-not-access-the-result-in-php