Jump to content


render the mysql query

render query

  • Please log in to reply
3 replies to this topic

#1 ben

ben

    Member

  • Members
  • PipPip
  • 10 posts

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



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 15 May 2014 - 07:09 PM

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



#3 ben

ben

    Member

  • Members
  • PipPip
  • 10 posts

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?



#4 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

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 :)







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users