Jump to content
Sign in to follow this  
sps-merlin

1064 error when testing payments via Protx Direct

Recommended Posts

Please forgive my noobishness on this - I'm sure with more awareness of PHP I might be able to solve this myself but alas, I'm just starting out learning right now...

 

My problem is:

 

I am configuring my osC installation (as provided and hosted by terranetwork.net) and am just arriving at the stage where I want to perform some test sales before I start adding stacks of products. I've installed Protx Direct 4.3 (as I already use Protx for card payments and therefore have a vendor account already setup) and everything worked fine (worked through the instructions, installed through the admin console->modules etc.) but when I try to complete a sale I get:

 

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 '-_db1 like 'orders'' at line 1

 

SHOW TABLE STATUS from merlincommerce_co_uk_-_db1 like 'orders'

 

I've read a substantial amount on similar errors before posting but, although it appears it might be a bug with hyphenated database names, I've no idea how to combat the issue.

 

Any help would be massively appreciated - thank you in advance for your time

Share this post


Link to post
Share on other sites

it appears as though the message is generated from a command within protx_process.php - line 163, it looks like

 

$last_order_id_query = tep_db_query("SHOW TABLE STATUS from " . DB_DATABASE . " like '" . TABLE_ORDERS . "'");

$last_order_id = tep_db_fetch_array($last_order_id_query);

$new_order_id = $last_order_id['Auto_increment'];

} else {

$last_order_query = "SELECT `orders_id` from `" . TABLE_ORDERS . "` ORDER BY `orders_id` DESC LIMIT 1";

$last_order = tep_db_fetch_array(tep_db_query($last_order_query));

$new_order_id = (int)$last_order['orders_id'] + 1;

}

$order_description = 'Order Number: ' . $new_order_id;

 

 

how do i stop the database being called that (i.e. with the '_-_db1' on the end)?

Share this post


Link to post
Share on other sites

try changing

$last_order_id_query = tep_db_query("SHOW TABLE STATUS from " . DB_DATABASE . " like '" . TABLE_ORDERS . "'");

to

$last_order_id_query = tep_db_query("SHOW TABLE STATUS from '" . DB_DATABASE . "' like '" . TABLE_ORDERS . "'");

 

If that doesn't work change

$use_more_accurate_order_id = true;

to

$use_more_accurate_order_id = false;

 

Tom

Share this post


Link to post
Share on other sites

thanks tom, that's definitely done something but it tells me:

 

1146 - Table 'merlincommerce_co_uk_-_db1.TABLE_PROTX_DIRECT' doesn't exist

insert into TABLE_PROTX_DIRECT (id, customer_id, order_id, vendortxcode, txtype, value, vpstxid, status, statusdetail, txauthno, securitykey, avscv2, address_result, postcode_result, CV2_result, 3DSecureStatus, CAVV, txtime) values ('', '2', '1', '1-14945917781025007017825510001382', 'PAYMENT', '500.00', '{7CE11EBC-09BC-E1F1-84FA-4510B0AC5BFB}', 'OK', '0000 : The Authorisation was Successful.', '3494492', 'YIIKBYRUIA', 'DATA NOT CHECKED', 'NOTCHECKED', 'NOTCHECKED', 'NOTCHECKED', 'NOTCHECKED', '', '2007-07-13 14:28:38')

Share this post


Link to post
Share on other sites

it's ok tom, i got it sorted thanks to vger - i was trying to use a version higher than 3.0c, which is what the problem was.

 

thanks very much for your help though

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
Sign in to follow this  

×