Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

fix 1525 error on website


zironasgifts

Recommended Posts

Posted

The reason it is failing is because the value entered for date_scheduled in the statement is invalid. The fix depends on how the call is being created. You don't supply enough details to say more than that, like what version of oscommerce and where the failure happens.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

It seems almost certain it is this line:  https://github.com/gburton/CE-Phoenix/blob/880761995f11435e4909a3aa734b0b4ee1f4ba4c/includes/functions/banner.php#L28

Which was in every release of osCommerce for fifteen years but has been gone from CE Phoenix since at least version 1.0.3.0. 

Simple fix:  switch from whatever version of osCommerce to the latest CE Phoenix.  If you haven't gotten too far in your process, this may be simplest. 

More complicated fix:  change the banner code to check against NULL rather than an empty string. 

Alternative fix:  change the line to

    $banners_query = tep_db_query("SELECT banners_id, date_scheduled FROM banners WHERE date_scheduled < NOW()");

This will also produce fewer results and would allow you to simplify the PHP code. 

Always back up before making changes.

Posted

It occurs to me that it might need to be

    $banners_query = tep_db_query("SELECT banners_id, date_scheduled FROM banners WHERE date_scheduled > '2000-01-01' AND date_scheduled < NOW()");

Since you want to mask out zero dates.  It's possible that

    $banners_query = tep_db_query("SELECT banners_id, date_scheduled FROM banners WHERE date_scheduled IS NOT NULL AND date_scheduled < NOW()");

would work.  And considering what the function does, replacing the contents with

    tep_db_query("UPDATE banners SET status = 1, date_status_change = NOW(), date_scheduled = NULL WHERE date_scheduled IS NOT NULL AND date_scheduled < NOW()");

would most likely work and be simpler. 

Always back up before making changes.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...