Delete query deletes from all usesrs
Why does this
Code:
|
bump. Ideas, friends? :catfish:
|
The problem is in this code not the above code:
Code:
elseif (isset($_POST['deltab'])) { |
First of all your script has a problem with the usage of $num. It is an array fetched using a PDO method, and you are checking if its value equals to 0? An array cannot equal to 0 unless it contains only one element(which is considered a string instead), the statement will always evaluate to be false...
On the other hand, you are using the delete() method incorrectly. It does not accept an empty array as its second argument, so get rid of it. I am surprised that you do not receive an error message for the way you use delete(). |
So what would that look like?
|
This should suffice:
PHP Code:
|
Ahhh works like a dream. Thought it would look like that but I didn't realize you didn't have to have the array() there.
|
Well you can always browse through the existing script files, including those in admincp, classes and functions directories. There should be plenty of examples that tell you how to use a database method such as update() and delete().
|
I do.... must not have come across those O.o
|
All times are GMT -5. The time now is 03:01 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.