Jump to content


Can CRUD operated on SQL Views !? Why did it fail ...

DB View open issue

  • Please log in to reply
3 replies to this topic

#1 ci-expert

ci-expert

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationThe Silicon Vally of Israel

Posted 28 April 2012 - 11:06 PM

Hi,

I have created a View and was trying to use GCRUD to view it only using $crud->unset_operations();

$crud->set_table('view_table');
$crud->set_subject('VIEW TEST');

$crud->columns( 'tik_reference', 'tik_status',
'wedding_plan_date', 'wedding_plan_hour'
);

// Enable As Ready only

$crud->unset_operations();
$output = $crud->render();
$this->show_table_view($output);
}

I keep getting the following error though in an checkup all fields are OK in this test view (I've made it to show ONLY 2 rows)!
Any clue ??

Fatal error: Cannot access empty property in /var/www/html/TNDEV/application/libraries/grocery_crud.php on line 1298

#2 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,043 posts
  • LocationLondon

Posted 30 April 2012 - 05:54 PM

I will check to see if there is a quick fix for that. Though grocery CRUD isn't tested and not support yet SQL views.
Posted Image

#3 belllee

belllee

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 01 March 2013 - 06:26 AM

Hi, can support VIEW now?

There are some error in $data->primary_key, when i use VIEW.Because there is no primary_key in VIEW.

So i judge the state of $data->primary_key,if it is false,don't use it.

 

I will check to see if there is a quick fix for that. Though grocery CRUD isn't tested and not support yet SQL views.



#4 belllee

belllee

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 04 March 2013 - 09:14 AM

I have found another way to use VIEW.

You can set primary_key by set_primary_key

 this->grocery_crud->set_primary_key('taskDate');

 

and this key must be unique.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users