osCmax v2.5 User Manual
Results 1 to 3 of 3

Problem with MySQL 4

This is a discussion on Problem with MySQL 4 within the osCMax v1.7 Installation forums, part of the osCmax v1.7 Forums category; I had our OSMAX running fine under a server with apache 1.3x and MySQL MySQL-3.23.58-1, we moved it over to ...

      
  1. #1
    New Member
    Join Date
    Nov 2004
    Posts
    6
    Rep Power
    0


    Default Problem with MySQL 4

    I had our OSMAX running fine under a server with apache 1.3x and MySQL MySQL-3.23.58-1, we moved it over to a newer server with Apache 2.x and MySQL-server-4.1.8-0.
    My Problem is when you go to certain menu options like reports I get this error:

    Best Customer Orders-Total
    1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-12, 12' at line 1

    select c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price) as ordersum from customers c, orders_products op, orders o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC limit -12, 12

    [TEP STOP]

    Most of the other menus, and the front end run just fine....

    I used MySQL administrator to backup from the old server, and restore to the new server the DB. Then I did an Oscommerce backup, and a command line restore as specified in the docs, with the same result.

    Any ideas?

    Thanks!

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default RE: Problem with MySQL 4

    osC is not compatible with mysql 4.1.x. Downgrade to 4.0.x Otherwise, you will have to track down the problems with the php code and fix them to be compatible with 4.1.x
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    Member
    Join Date
    Jan 2004
    Location
    Netherlands
    Posts
    71
    Rep Power
    0


    Default Re: RE: Problem with MySQL 4

    I'm running osC on mysql 4.1.x, and don't experience any problems, after a small bug fix

    I'm allmost sure the mentioned problem is caused by the split_page_results.php bug wich causes negative limits (like: limit -12, 12) which aren't allowed.

    see: http://www.oscommerce.com/community/bugs,2300

    solution ( both admin and catalog):

    Code:
    $offset = ($max_rows_per_page * ($current_page_number - 1));
    $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
    to

    Code:
    $offset = ($max_rows_per_page * ($current_page_number - 1));
    if ($offset < 0) $offset = 0;
    $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

Similar Threads

  1. Compatible with PHP 4.33 and mysql 3.23
    By the_error_king in forum osCmax v2 Installation issues
    Replies: 6
    Last Post: 06-15-2005, 07:19 PM
  2. MySQL problem
    By calle in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 11-23-2004, 01:44 PM
  3. MySQL? Please help!
    By extremenewb in forum osCommerce 2.2 Installation Help
    Replies: 3
    Last Post: 09-22-2004, 07:31 AM
  4. mySQL database
    By mattias2 in forum osCommerce 2.2 Installation Help
    Replies: 1
    Last Post: 10-23-2003, 06:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •