Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bug with MySQL 4.1 ?


bruno_caramiel

Recommended Posts

First I'd like to say that other topics I found about this problem didn't help me.

 

Problem, on /admin/orders.php :

 

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 'select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last' at line 1

select count(select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = \'1\' and s.orders_status_id = \'1\' and ot.class = \'ot_total\' order by o.orders_id DESC) as total

 

Notice that this bug is different from that one :

http://www.oscommerce.com/forums/index.php?showtopic=144095&st=0

 

Any idea ?

Link to comment
Share on other sites

More informations...

 

The problem seems to be that in /admin/orders.php, we got this :

 

$orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);

 

and $HTTP_GET_VARS['page'] is empty....

 

So, in /admin/includes/classes/split_page_results.php, we got this :

 

 function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') {
     global $HTTP_GET_VARS, $HTTP_POST_VARS;

     $this->sql_query = $query;

 

But $query is empty !! That's why the next mysql query doesn't work.

 

Temporary solution if you really need your admin to work, such as me :

 

Search :

 

$count_query = tep_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from)));
$count = tep_db_fetch_array($count_query);
$this->number_of_rows = $count['total'];

 

Replace by :

 

//      $count_query = tep_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from)));
//      $count = tep_db_fetch_array($count_query);
//      $this->number_of_rows = $count['total'];

 

Here it is... ( but help :'( )

Edited by bruno_caramiel
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...