⚠ 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

edit form with no primary key in URL



Rob Curle
  • profile picture
  • Member

Posted 28 April 2014 - 11:00 AM

is it possible to use only the edit form without passing in the primary key in the url?   ...if say, you want to hide the ID from the user

 

for example

http://www.grocerycrud.com/demo/offices_management/edit

 

instead of

http://www.grocerycrud.com/demo/offices_management/edit/2

 

 

i get this error with the first example:

An Error Was Encountered

On the state "edit" the Primary key cannot be null --- #0 /home/groceryc/public_html/application/libraries/Grocery_CRUD.php(4377): grocery_CRUD_States->getStateInfo() #1 /home/groceryc/public_html/application/controllers/demo.php(150): Grocery_CRUD->render() #2 [internal function]: Demo->offices_management('edit') #3 /home/groceryc/public_html/system/core/CodeIgniter.php(359): call_user_func_array(Array, Array) #4 /home/groceryc/public_html/index.php(202): require_once('/home/groceryc/...') #5 {main}

many thanks,

rob.


Amit Shah
  • profile picture
  • Member

Posted 29 April 2014 - 22:29 PM

well technically i would say no that s not possible - cuz GC scans the url to get he PK .. the id of the row 2 edit.. how is GC gona know wt to edit ..?


jay_patel
  • profile picture
  • Member

Posted 01 January 2015 - 06:33 AM

well technically i would say no that s not possible - cuz GC scans the url to get he PK .. the id of the row 2 edit.. how is GC gona know wt to edit ..?

how gc scan pk..?


Amit Shah
  • profile picture
  • Member

Posted 04 January 2015 - 22:37 PM

GC scans the PK from the URL