Using SQL Aggregate Functions [message #1286] |
Thu, 13 March 2008 06:58 |
|
Hi Sir Tony,
I was trying to use the framework to get MAX (`student_id`) from the crs_student table using getdata_raw setting $this->sql_select. First, it required using the "GROUP BY", but I still I keep getting unexpected results.
in MySQL --> SELECT MAX (`student_id`) AS last_id FROM `crs_student`
in Radicore
$this->sql_select = "MAX (`student_id`) AS last_id"
$rows=$this->getdata_raw("");
$rows[0]['last_id'] <-- expecting to contain largest student_id
-------
Result is not the largest ID.
How can I use aggregate functions in the getdata series or am I doing things the wrong way and making faulty assumptions?
THanks again.
Melvin
|
|
|