tag:blogger.com,1999:blog-611277469305933739.post8548978002385471395..comments2023-10-24T05:01:36.272-07:00Comments on my-CakePHP: CakePHP - Delete a Record from DatabaseSiddharthahttp://www.blogger.com/profile/04012747042515614464noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-611277469305933739.post-74256821633492512392011-04-14T11:40:54.526-07:002011-04-14T11:40:54.526-07:00Thanks. It is my pleasure that you have found this...Thanks. It is my pleasure that you have found this blog useful.. Yup! THE points you have noted is correct. I made this entry as I was learning cake for self help. Now I see a lot of New-to-cake developers have found this useful. Keep visiting. I'll try to keep the content updated as and when needed.Siddharthahttps://www.blogger.com/profile/04012747042515614464noreply@blogger.comtag:blogger.com,1999:blog-611277469305933739.post-3493655279990795452011-04-13T22:25:01.765-07:002011-04-13T22:25:01.765-07:00While using the above code to delete, it gave me a...While using the above code to delete, it gave me an error. I searched and found a way. The way is to make a few changes to the code above, in these files:<br /><br />1. In posts_controller.php file,<br /><br />Use <br />function delete($id=Null) <br /><br />Instead of <br />function delete()<br /><br />2. In index.ctp file,<br /><br />Use<br />$html->link('Delete', array('action' => 'delete', $post['Post']['id']), null, 'Are you sure?' )<br /><br />Instead of<br />$html->link('Delete', array('action' => 'delete', 'id' => $post['Post']['id']), null, 'Are you sure?' )<br /><br />Thanks to Siddhartha for providing an easy documentation, for Cake Newbies.Unknownhttps://www.blogger.com/profile/08495937552936399991noreply@blogger.com