Dashboard custom sql
Archived from the Xataface Users forum.
tomhousley — Tue Mar 20, 2012 9:04 am
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
shannah — Tue Mar 20, 2012 12:44 pm
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.