Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

:'( However, after copying new files that came with the Western Union setup, I am now getting this error. Can someone explain to me what this is referring to...apparently something in the SQL... Nowhere in the install was I instructed to edit any SQL so I am lost...

 

My Order History...

 

 

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.orders_status, o.date_purchased, o.delive

 

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

 

[TEP STOP]

 

Here is the code the account_history.php file.... This is the file that came with the install... I appreciate any

insight you can provide....

 

 

 

<?php

/*

$Id: account_history.php,v 1.1 2002/11/21 14:31:43 elarifr Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 2002 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY);

 

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

<?php

$history_query_raw = "select o.orders_id, o.orders_status, o.date_purchased, o.delivery_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_ORDERS_STATUS . " s on (o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "') where o.customers_id = '" . $customer_id . "' and ot.class = 'ot_total' order by orders_id DESC";

$history_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_ORDER_HISTORY, $history_query_raw, $history_numrows);

$history_query = tep_db_query($history_query_raw);

 

$info_box_contents = array();

 

if (tep_db_num_rows($history_query)) {

while ($history = tep_db_fetch_array($history_query)) {

$products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $history['orders_id'] . "'");

$products = tep_db_fetch_array($products_query);

 

if ( $history['orders_status']== MODULE_PAYMENT_COD_ORDERS_STATUS_UNCONF )

{

$order_heading = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" .

' <tr>' . "\n" .

' <td class="main"><b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id'] . '</td>' . "\n" .

' <td class="main" align="right"><b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name'] .

' <class="smallText"><a href="' . tep_href_link("account_customer_confirm.php", 'order_id=' . $history['orders_id'], 'SSL') . '"><img src= ' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_confirm_order.gif border=0 ></a> </td>' . "\n" .

' </tr>' . "\n" .

'</table>';

}

 

 

 

else

{

$order_heading = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" .

' <tr>' . "\n" .

' <td class="main"><b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id'] . '</td>' . "\n" .

' <td class="main" align="right"><b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name'] . '</td>' . "\n" .

' </tr>' . "\n" .

'</table>';

}

 

$order = '<table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" .

' <tr>' . "\n" .

' <td class="main" width="50%" valign="top"><b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) . '<br><b>' . TEXT_ORDER_SHIPPED_TO . '</b> ' . $history['delivery_name'] . '</td>' . "\n" .

' <td class="main" width="30%" valign="top"><b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] . '<br><b>' . TEXT_ORDER_COST . '</b> ' . strip_tags($history['order_total']) . '</td>' . "\n" .

' <td class="main" width="20%"><a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'page=' . $HTTP_GET_VARS['page'] . '&order_id=' . $history['orders_id'], 'SSL') . '">' . TEXT_VIEW_ORDER . '</a></td>' . "\n" .

' </tr>' . "\n" .

'</table>';

 

new tableBox(array(array('text' => $order_heading)), true);

new infoBox(array(array('text' => $order)));

 

echo '<br>';

}

} else {

new infoBox(array(array('text' => TEXT_NO_PURCHASES)));

}

?>

</td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

if (tep_db_num_rows($history_query)) {

?>

<tr>

<td class="smallText" valign="top"><?php echo $history_split->display_count($history_numrows, MAX_DISPLAY_ORDER_HISTORY, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>

<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE; echo $history_split->display_links($history_numrows, MAX_DISPLAY_ORDER_HISTORY, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

</tr>

</table></td>

</tr>

</table></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Posted

After going to the SQL database, I see that the "o" fields are not defined and that some of the other fields in the following paragraph makes no sense to me. Can someone tell me of the appropriate coding for this section. I am wondering where these field names came from.... At any rate, any help in resolving this would be appreciated...

 

<?php

$history_query_raw = "select o.orders_id, o.orders_status, o.date_purchased, o.delivery_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_ORDERS_STATUS . " s on (o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "') where o.customers_id = '" . $customer_id . "' and ot.class = 'ot_total' order by orders_id DESC";

$history_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_ORDER_HISTORY, $history_query_raw, $history_numrows);

$history_query = tep_db_query($history_query_raw);

Posted (edited)

Please can someone help me with this? I'm clueless :(....

 

Also in the Previous Orders History this error is occuring...

 

 

Warning: main(includes/languages/english/FILENAME_ACCOUNT_CUSTOMER_CONFIRM): failed to open stream: No such file or directory in /hsphere/local/home/skeeweea/absolutelybeautifulhairillusions.com/catalog/account_history_info.php on line 27

Edited by skeeweeaka
Posted (edited)
Please can someone help me with this? I'm clueless :(....

 

Also in the Previous Orders History this error is occuring...

Warning: main(includes/languages/english/FILENAME_ACCOUNT_CUSTOMER_CONFIRM): failed to open stream: No such file or directory in /hsphere/local/home/skeeweea/absolutelybeautifulhairillusions.com/catalog/account_history_info.php on line 27

 

Hmm....this is just odd. Can someone else tell me whether they used this contribution and did it work???? Cause I am just adding the files that they created and there were no changes to my account history files prior to this. When I change them back they work just fine.

 

In the account_history_info file this was there...

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY_INFO);

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_CUSTOMER_CONFIRM);

 

I deleted the second line and some of the text now appears when selecting Account, Order Information, View, I am getting this error instead of the first one.

1054 - Unknown column 'osh.new_value' in 'where clause'

 

select os.orders_status_name, osh.date_added from orders_status os, orders_status_history osh where osh.orders_id = '220' and osh.new_value = os.orders_status_id and os.language_id = '1' order by osh.date_added desc

 

[TEP STOP]

 

This along with 1064 at the top of the page.... Apparently, from what I gather the field names are incorrect, but can someone tell me what to change them to, etc.

 

Please someone familiar with this module can you help???

 

Terry

Edited by skeeweeaka
Posted
Hmm....this is just odd. Can someone else tell me whether they used this contribution and did it work???? Cause I am just adding the files that they created and there were no changes to my account history files prior to this. When I change them back they work just fine.

 

In the account_history_info file this was there...

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY_INFO);

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_CUSTOMER_CONFIRM);

 

I deleted the second line and some of the text now appears when selecting Account, Order Information, View, I am getting this error instead of the first one.

1054 - Unknown column 'osh.new_value' in 'where clause'

 

select os.orders_status_name, osh.date_added from orders_status os, orders_status_history osh where osh.orders_id = '220' and osh.new_value = os.orders_status_id and os.language_id = '1' order by osh.date_added desc

 

[TEP STOP]

 

This along with 1064 at the top of the page.... Apparently, from what I gather the field names are incorrect, but can someone tell me what to change them to, etc.

 

Please someone familiar with this module can you help???

 

Terry

 

 

 

ELARI CAN YOU HELP ME WITH THIS... I TRIED TO EMAIL YOU BUT COULDN'T BECAUSE YOUR BOX IS FULL...?????

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...