
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);
Bookmarks