⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

render the mysql query



ben

ben
  • profile picture
  • Member

Posted 15 May 2014 - 08:57 AM

hi,

is it possible to render out the mysql query?

For example, i use this code to get all the tables in the database:    $this->db->list_tables();

How can i display the result (list of table names) in flexi-grid using grocery crud?  $output = $_crud->render();

regards


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 15 May 2014 - 19:09 PM

i will recommend - use codeigniter profiling option and u will get all the queries that it ran through


ben

ben
  • profile picture
  • Member

Posted 16 May 2014 - 01:48 AM

hi Amit, thanks. I've learnt new thing today: profiler . But this is not what i'm looking for. I want to display the query result in the grocery crud table. Is this possible?


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 19 May 2014 - 08:43 AM

well that might need a certain hack but if not mistaken.. the profile should still run and generate the same query output in the ajax result also.

But anyways... all the queries that execute .. are all there in the grocery_crud_model.php... what i can suggest you to do is.. create a log file and make log entries of all the queries that gets executed - this way it will help u debug stuff whatever is required.. and not disturb the screen. Cuz if u noticed the queries ran in the profiler - there aint just 1 single query but many ...

if u look to specifically generate just 1 (main) query - that shows result then u need to just alter an echo @line 88 in the grocery_crud_model.php in function get_list ... just before the return - echo $this->db->last_query();

 

Hope that helps u resolve your requirements

 

Happy GCing :)