Dashboard custom sql

A place for users and developers of the Xataface to discuss and receive support.

Dashboard custom sql

Postby 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
tomhousley
 
Posts: 52
Joined: Thu Feb 26, 2009 1:02 am
Location: United Kingdom

Re: Dashboard custom sql

Postby 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.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 19 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved