I have a table set up as the following
ID COL1 COL2 COL3
----------------
10 200 n/a 125
11 150 130 n/a
12 100 300 200
13 500 n/a n/a
Other than ID all columns are TEXT.
Using PHP and MySQL I need to select the minimum "number" from COL1,COL2,COL3, in this case it would be 100 (from row 12, COL1).
I tried this:
$query = ("SELECT MIN(LEAST(COL1,COL2,COL3)) FROM rug AS 'query1'");
but I think something is wrong with the MIN(LEAST and also the AS 'query1' part. I'm getting a warning:
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource
Any thoughts? Thanks!