Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

How to delete and i...
 
Notifications
Clear all

How to delete and item

4 Posts
2 Users
0 Reactions
3,279 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
(@babynus)
Posts: 14966
Main Contributor 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
(@babynus)
Posts: 14966
Main Contributor 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