Forums / Bug Reports / [DONE] SQL Delete statement error from admin's customers page.

[DONE] SQL Delete statement error from admin's customers page.

Locked

Started by theoracle on 12 Jul 2006, 9:55 PM · Views: 2,623

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
12 Jul 2006, 9:55 PM
#1
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

[DONE] SQL Delete statement error from admin's customers page.

@Wilt:

From your admin/customers.php file,

change:

while (!$reviews->EOF) {
            $dbExecute("delete from " . TABLE_REVIEWS_DESCRIPTION . "
                        where reviews_id = '" . (int)$reviews['reviews_id'] . "'");
            $reviews->MoveNext();
          }

to read:

while (!$reviews->EOF) {
            $db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . "
                        where reviews_id = '" . (int)$reviews['reviews_id'] . "'");
            $reviews->MoveNext();
          }

You forgot to call the method name inside the object name as only an unexistent variable name has been set right now. :wink2:

12 Jul 2006, 11:02 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [DONE] SQL Delete statement error from admin's customers page.

Good catch.

There's another part missing in that same section. The correction is this:```php
while (!$reviews->EOF) {
$db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . "
where reviews_id = '" . (int)$reviews->fields['reviews_id'] . "'");
$reviews->MoveNext();
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 Jul 2006, 11:06 PM
#3
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: [DONE] SQL Delete statement error from admin's customers page.

I don't see another one like that anywhere on the script as I'm using the latest version. Perhaps it was coded afterwords ? :wink2:

13 Jul 2006, 2:47 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [DONE] SQL Delete statement error from admin's customers page.

$reviews['reviews_id']
vs
$reviews->fields['reviews_id']

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Jul 2006, 2:49 AM
#5
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: [DONE] SQL Delete statement error from admin's customers page.

Ahh ! yes, I see it now. Very well, thanks for the update.