Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Using SQL Aggregate Functions (How to use MAX, AVE, SUM, etc.)
Using SQL Aggregate Functions [message #1286] Thu, 13 March 2008 06:58 Go to previous message
melvinsdb is currently offline  melvinsdb
Messages: 16
Registered: November 2006
Location: Philippines
Junior Member

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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: creating list items
Next Topic: How do you deploy your app?
Goto Forum:
  


Current Time: Mon Nov 25 11:24:40 EST 2024

Total time taken to generate the page: 0.02922 seconds