Page 1 of 1

Dashboard custom sql

PostPosted: Tue Mar 20, 2012 9:04 am
by tomhousley
Hello,

I have created a dashboard as per: http://xataface.com/wiki/Creating_a_Dashboard

How to I include a relatively complex sql query into df_get_records_array in the actions/dashboard.php?

My query is this:
Code: Select all
SELECT `tbl_job`.`job_id`, LEFT(CONCAT(`tbl_job`.`job_id`,' - ',`tbl_organisation`.`org_name`,' - ',`tbl_job`.`job_description`),80) as jobdescription FROM `tbl_job`STRAIGHT_JOIN `tbl_organisation` ON `tbl_job`.`org_id` = `tbl_organisation`.`org_id`WHERE job_status < 6 ORDER BY `tbl_job`.`job_id` DESC


Tried various ways... but none work...

Many thanks, Tom

Re: Dashboard custom sql

PostPosted: Tue Mar 20, 2012 12:44 pm
by shannah
df_get_records_array() returns an array of records given a table name and a list of Xataface query parameters to filter the results. It doesn't take raw SQL. Use df_query() or mysql_query() for raw sql.