Forum

How to delete and i...
 
Notifications
Clear all

How to delete and item

4 Posts
2 Users
0 Reactions
3,255 Views
 imen
(@imenkolsi)
Posts: 37
Active Member
Topic starter
 
[#922]

Hi i was wondering if you already wrote a function that i can use to delete and item from the database

well i looked in the SqlElement.php but could find nothing

So please can you tell me how can i delete an item

thanks in advance


 
Posted : 28 Jan 2013 12H27
(@babynus)
Posts: 14952
Member Admin
 

Every object than extends SqlElement has a method delete()


 
Posted : 28 Jan 2013 13H19
 imen
(@imenkolsi)
Posts: 37
Active Member
Topic starter
 

ok so if i want to delete a resource by the id

i put something like this

$resource = new Resource ($id);
$resource->delete();

it didn't work for me ? would u help me please


 
Posted : 28 Jan 2013 13H28
(@babynus)
Posts: 14952
Member Admin
 

you'd better write

$resource = new Resource ($id);
$result=$resource->delete(); 

Then you've got the result of delete operation (as a message that will be displayed).
You can see for instance in /tool/deleteObject.php how this result can be managed.


 
Posted : 28 Jan 2013 13H44
Share:

Scroll to Top