Re: Error when confirming delete customer
Quote:
Originally Posted by
DrByte
I couldn't agree more.
But the pain of renaming all the fields in almost a hundred tables is an upgraders nightmare! We debate it during every other upgrade release.
We've considered that for v2. But in reality, if we provide proper functions to allow all those things to happen thru function calls, then (almost) nobody should be writing their own queries anyway, thus minimizing the risk of the pain impacting many people other than perhaps mod-developers until they switch over to using the (some yet to be written) built-in functions.
Best to bite the bullet and "geter done!" This also has to happen with the CSS code and whether everything happens quickly or at least as fast as a turtle can run, many hands make the work load lighter. :hug:
With hindsight for guidance and advancements in modular code, shouldn't take as long as one might think. Especially if we all bite the bullet and realize at some point, legacy code needs to be left behind and cannot be used for the newer, more easier to work with coding which will be better for all.
Re: Error when confirming delete customer
Quote:
Originally Posted by
Website Rob
Best to bite the bullet and "geter done!" This also has to happen with the CSS code and whether everything happens quickly or at least as fast as a turtle can run, many hands make the work load lighter. :hug:
With hindsight for guidance and advancements in modular code, shouldn't take as long as one might think. Especially if we all bite the bullet and realize at some point, legacy code needs to be left behind and cannot be used for the newer, more easier to work with coding which will be better for all.
having dealt with (and continuing to deal with) my share of legacy code, it is much easier to be on the outside looking in, and telling the dev team what to do, then to actually do it.
once named, changing variables down the line presents all kinds of problems; lets say the dev team makes the change. what then happens to all of the plugins modifications one has done to their implementation of ZC? what about those plugins that do not have any person(s) maintaining the code? and frankly is it worth the dev team to focus on this as opposed to other features?
Re: Error when confirming delete customer
Code:
$db->Execute("delete from " . TABLE_WHOS_ONLINE . "
where customer_id = '" . (int)$customers_id . "'");
$db->Execute("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = " . $customers_id);
[/QUOTE]
This one
Quote:
where customers_id = '" . (int)$customers_id . "'");
is working for me too. I saw this tread afterwards. Which one is better?
Re: Error when confirming delete customer
Quote:
Originally Posted by
stefanb
Code:
$db->Execute("delete from " . TABLE_WHOS_ONLINE . "
where customer_id = '" . (int)$customers_id . "'");
$db->Execute("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = " . $customers_id);
This one is working for me too. I saw this tread afterwards. Which one is better?[/QUOTE]
Casting the value to int is better (more secure) though the single quotes around that value are unnecessary and requires the sql database to convert the now string into an integer (in a sense double casting by variable to integer inserted into sql as a string that is then converted to a number/integer from there), so this would be the better of the two:
Code:
where customers_id = " . (int)$customers_id);