Jump to content
zironasgifts

fix 1525 error on website

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×