Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Another problem


Guest

Recommended Posts

Posted
1054 - Unknown column 'customer_id' in 'field list'

 

insert into orders (customer_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, currency_value) values ('4', 'Joel Test Gallant', '', '32 35th Ave', '', 'Edmundston', 'E3V 2T8', 'New Brunswick', 'Canada', '506-870-0054', '[email protected]', '1', 'Joel Test Gallant', '', '32 35th Ave', '', 'Edmundston', 'E3V 2T8', 'New Brunswick', 'Canada', '1', 'Joel Test Gallant', '', '32 35th Ave', '', 'Edmundston', 'E3V 2T8', 'New Brunswick', 'Canada', '1', 'Check/Money Order', '', '', '', '', now(), '1', 'CAD', '1.00000000')

 

[TEP STOP]

 

 

Does anyone have any idea how I can get rid of this wonderful error?

 

All I am trying to do is purchase something & pay via check or money order.... I haven't done any modifications lately other then adding the paypal IPN which is working perfectly fine....

 

Hope someone can give me a hand with this ASAP... I have another client waiting to put an order through.

 

Thanks as always!

Posted

This is caused by a mismatch between the file and your database. Go into phpmyadmin and look at your orders table and make sure you have a customers id field, it should be the second one. If not somehow it was deleted and you should add it back in.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Posted

This is what I have in my orders table

customers_id / int / 11 / not null / 0

 

 

Is that what it's supposed to look like? :unsure:

 

I've compared it to my dummy store & it looks exactly the same... Got any other suggestions?

Posted

Computer coding is VERY particular - customer_id (which you have in your code) is not the same as customers_id (which you have in your table).

 

Please don't bump your posts.

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Posted

Ok, that doesn't tell me anything... I thought customer_id was the same no matter where it was....

 

I was told to check the database & that's what I did!

 

PS - The bump was due to the fact that I have a customer waiting to put an order through. So, I was hopping that it could be solved as quickly as possible.

Posted
Ok, that doesn't tell me anything... I thought customer_id was the same no matter where it was....

 

I was told to check the database & that's what I did!

 

PS - The bump was due to the fact that I have a customer waiting to put an order through. So, I was hopping that it could be solved as quickly as possible.

What he is saying is that in your error message it says

 

'customer_id' No s

 

and what you said you found in your database was

 

customers_id / int / 11 / not null / 0 Notice that this has an s

 

Now when I look at my database it has an s so the error is in your file instead of the database. If you look closer at the error message and I missed it the first time myself you need to change the code in the file

 

look at the error message

 

insert into orders (customer_id, customers_name, customers_company, customers_street_address,

 

See where it says customer_id, but the rest of the fields say customers_name etc.

 

Fix that line in your file so it says customers_id and you should be good to go.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Posted

Now, that makes perfect sense.... but which file should I be looking at to make the change?

 

I'd guess, but I'd probably screw everything up again! LOL!!!

Posted
Now, that makes perfect sense.... but which file should I be looking at to make the change?

 

I'd guess, but I'd probably screw everything up again! LOL!!!

Try

admin/includes/classes/order.php on or about line 27

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Posted

Ok, this is what I have in that particular file

 

 function query($order_id) {
     //begin PayPal_Shopping_Cart_IPN
$order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, paypal_ipn_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
//end PayPal_Shopping_Cart_IPN
     $order = tep_db_fetch_array($order_query);

     $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
     while ($totals = tep_db_fetch_array($totals_query)) {
       $this->totals[] = array('title' => $totals['title'],
                               'text' => $totals['text']);
     }

     $this->info = array('currency' => $order['currency'],
                         'currency_value' => $order['currency_value'],
                         'payment_method' => $order['payment_method'],
                         'cc_type' => $order['cc_type'],
                         'cc_owner' => $order['cc_owner'],
                         'cc_number' => $order['cc_number'],
                         'cc_expires' => $order['cc_expires'],
                         'date_purchased' => $order['date_purchased'],
                         'orders_status' => $order['orders_status'],
                     //begin PayPal_Shopping_Cart_IPN
       'paypal_ipn_id' => $order['paypal_ipn_id'],
                     //end PayPal_Shopping_Cart_IPN
                         'last_modified' => $order['last_modified']);

     $this->customer = array('name' => $order['customers_name'],
                             'company' => $order['customers_company'],
                             'street_address' => $order['customers_street_address'],
                             'suburb' => $order['customers_suburb'],
                             'city' => $order['customers_city'],
                             'postcode' => $order['customers_postcode'],
                             'state' => $order['customers_state'],
                             'country' => $order['customers_country'],
                             'format_id' => $order['customers_address_format_id'],
                             'telephone' => $order['customers_telephone'],
                             'email_address' => $order['customers_email_address']);

These are lines 27 to 62.

 

Not sure if I'm missing a line of code or not... You will notice that I have installed the paypal IPN, so I'm not sure if something got deleted by accident....

Posted

To find what file to check in, you need to find what file is causing the error - it can be a bit of hide and seek with this code. What page were you trying to access when you saw this error? I would guess checkout_process.php, so that's a good place to start. Do a ctrl-f for "customer_id" - notice no "s" in that. If it's not in there, find the files that are included or required by checkout_process and search through them. You could probably find a way to search through an entire directory to find customer_id in any of the files in there...I think Windows XP has that capability, or you can use the command grep from the Linux command line if you have ssh access to your server.

 

By the way, if you just installed a module and you see this error, the first place to look would be any files that you added or modified when you installed it. The PayPal IPN module uses its own checkout_process file....I think it's checkout_paypalipn or something like that.

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Posted
To find what file to check in, you need to find what file is causing the error - it can be a bit of hide and seek with this code. What page were you trying to access when you saw this error? I would guess checkout_process.php, so that's a good place to start. Do a ctrl-f for "customer_id" - notice no "s" in that. If it's not in there, find the files that are included or required by checkout_process and search through them. You could probably find a way to search through an entire directory to find customer_id in any of the files in there...I think Windows XP has that capability, or you can use the command grep from the Linux command line if you have ssh access to your server.

 

By the way, if you just installed a module and you see this error, the first place to look would be any files that you added or modified when you installed it. The PayPal IPN module uses its own checkout_process file....I think it's checkout_paypalipn or something like that.

Ok, this is a little over my head... I have found the checkout_process.php file where it says customer_id, but I have no idea what you wanted me to do afterwards.

 

I have checked with my host to see if they could help me out, but they have no idea what's going on either.

 

I'm hoping that someone out there has an answer! I also check out the Paypal IPN contribution and there is not checkout_paypal or anything like that!

 

I'm starting to get to my withs (spelling???) end trying to figure this out!

 

Please help me out! I'm totally lost!

Posted

Dude,

 

You are making this way more complicated that it needs to be. You say you found where it says 'customer_id' change it to 'customers_id'.

 

notice the change.. customer_id vrs customer(s)_id

 

That should solve your problem.

 

Mondi

Posted

Ok, that is really really weird....

 

I had done that change before & it didn't work... Now it worked fine...

 

Raymond, thanks for the slap in the face to help me wake up! LOL!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...