By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,623 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,623 IT Pros & Developers. It's quick & easy.

SQL Update help - OsCommerce related

P: n/a
I am trying to integrate a Credit Card # deletion option into
Batch_print_center and need some help.

Batch_print_center has a form where you specify orders you want to
print or proccess by either entering in a range(ie, 3-9), a comma
separated list(ie, 3,4,5,6) or a range by start and end date(ie,
yyyy-MM-dd - yyyy-MM-dd)which is a javascript calendar widget.
Date_purchased is stored in the DB as 2005-04-12 13:19:13.

This first condition works if a range or comma separated list is
given, but the second start/end date range does not. I believe the
time stamp is not being added successfully.

// Clear Credit Card
if(($HTTP_POST_VARS['clear_CC'] == 'on') && ($invoicenumbers != '')) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = ''
where orders_id in (" . tep_db_input($invoicenumbers) . ") ");
} elseif (($HTTP_POST_VARS['clear_CC'] == 'on') &&
(isset($HTTP_POST_VARS['startdate'])) &&
(!isset($HTTP_POST_VARS['enddate']))) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = '' where
date_purchased between '" . $HTTP_POST_VARS['startdate'] . "' and '" .
$HTTP_POST_VARS['enddate'] . "23:59:59");
}
//

Any ideas?
TIA
"These animals evacuate ethyl alcohol from their bowels and carbon dioxide from their urinary organs. Thus, one can observe how a specially lighter fluid is exuded from the anus and rises vertically whereas a stream of carbon dioxide is ejected at very short intervals from enormously long genitales."

Justus Freiherr von Liebig - 1839
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Obviously no one cares and/or knew, but I figured out my problem.
Initially I had an errant ! that I didnt see which made the elseif
condition never true. Then there was a syntax problem when the query
encountered the colons. A few odd single quotes Here's the working
code:

// Clear Credit Card
if(($HTTP_POST_VARS['clear_CC'] == 'on') && ($invoicenumbers != '')) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = ''
where orders_id in (" . tep_db_input($invoicenumbers) . ") ");
} elseif (($HTTP_POST_VARS['clear_CC'] == 'on') &&
(isset($HTTP_POST_VARS['startdate'])) &&
(isset($HTTP_POST_VARS['enddate']))) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = '' where
date_purchased between '" . tep_db_input($startdate) . "' and '" .
tep_db_input($enddate) . "23:59:59'");
}
//

On Wed, 13 Apr 2005 14:22:04 -0600, MattMika
<rotaourATdimcomDEEOHTEEnet> wrote:
I am trying to integrate a Credit Card # deletion option into
Batch_print_center and need some help.

Batch_print_center has a form where you specify orders you want to
print or proccess by either entering in a range(ie, 3-9), a comma
separated list(ie, 3,4,5,6) or a range by start and end date(ie,
yyyy-MM-dd - yyyy-MM-dd)which is a javascript calendar widget.
Date_purchased is stored in the DB as 2005-04-12 13:19:13.

This first condition works if a range or comma separated list is
given, but the second start/end date range does not. I believe the
time stamp is not being added successfully.

// Clear Credit Card
if(($HTTP_POST_VARS['clear_CC'] == 'on') && ($invoicenumbers != '')) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = ''
where orders_id in (" . tep_db_input($invoicenumbers) . ") ");
} elseif (($HTTP_POST_VARS['clear_CC'] == 'on') &&
(isset($HTTP_POST_VARS['startdate'])) &&
(!isset($HTTP_POST_VARS['enddate']))) {
tep_db_query("update " . TABLE_ORDERS . " set cc_number = '' where
date_purchased between '" . $HTTP_POST_VARS['startdate'] . "' and '" .
$HTTP_POST_VARS['enddate'] . "23:59:59");
}
//

Any ideas?
TIA
"These animals evacuate ethyl alcohol from their bowels and carbon dioxide from their urinary organs. Thus, one can observe how a specially lighter fluid is exuded from the anus and rises vertically whereas a stream of carbon dioxide is ejected at very short intervals from enormously long genitales."

Justus Freiherr von Liebig - 1839


"These animals evacuate ethyl alcohol from their bowels and carbon dioxide from their urinary organs. Thus, one can observe how a specially lighter fluid is exuded from the anus and rises vertically whereas a stream of carbon dioxide is ejected at very short intervals from enormously long genitales."

Justus Freiherr von Liebig - 1839
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.