SQL database problem

Open to all! Ask other shopowners for help.
Post Reply
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

SQL database problem

Post by Xpajun »

I'm currently being driven around the bend with this problem

Inserting data into the orders table via the sql as follows:

Code: Select all

INSERT INTO orders (orders_id, customers_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, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value, shipping_module, customer_service_id, discount_codes) VALUES
(485, 422, 'Some Customer', '', '10 Some Street', 'Somewhere', 'Someplace', 'AA1 1AA', 'Devon', 'United Kingdom', '01234567890', 'skippy1983@hotmail.co.uk', 2, 'Some Customer', '', '10 Some Street', 'Somewhere', 'Someplace', 'AA1 1AA', 'Devon', 'United Kingdom', 2, 'Some Customer', '', '10 Some Street', 'Somewhere', 'Someplace', 'AA1 1AA', 'Devon', 'United Kingdom', 2, 'Other', '', '', '', '', '2011-04-20 19:05:18', '2011-04-20 12:52:16', 3, NULL, 'GBP', 1.000000, 'rmstandardparcel_rmstandardparcel', '', '1-CaptuRe', '');

Not just the one line of code but multiple
The Static analysis come up with the following error:
#1136 - Column count doesn't match value count at row 1

46 values were expected, but found 45. (near "(" at position 1392)
No matter how I count them the Value names and the Values equal the same amount of 45

What I want to know is where the extra value name is?
Last edited by burt on Wed Apr 24, 2024 3:17 pm, edited 1 time in total.
Reason: Remove Customer Details!!!


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
bonbec
Contributor
Posts: 190
Joined: Mon Oct 26, 2020 12:23 pm
Phoenix Version: V1.1.0.7
Has thanked: 54 times
Been thanked: 40 times

Re: SQL database problem

Post by bonbec »

Hello,
If 1-CaptuRe is the discount_code, what is the last value '' ?
Seems don't have a field.
Old MS2.2 PHP7.4 site being converted to CE Phoenix v1.1.0.6 PHP 8.3
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Re: SQL database problem

Post by Xpajun »

bonbec wrote: Wed Apr 24, 2024 1:33 pm Hello,
If 1-CaptuRe is the discount_code, what is the last value '' ?
Seems don't have a field.
1-CaptuRe is the customer_service_id last value is discount code

I think a lot of it is bad updating on my part
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18
User avatar
bonbec
Contributor
Posts: 190
Joined: Mon Oct 26, 2020 12:23 pm
Phoenix Version: V1.1.0.7
Has thanked: 54 times
Been thanked: 40 times

Re: SQL database problem

Post by bonbec »

If I put values in front of fieldnames :
orders_id 485
customers_id 422
customers_name Some Customer
customers_company ''
customers_street_address 10 Some Street
customers_suburb Some Place
customers_city Somewhere
customers_postcode AA1 1AA
customers_state Devon
customers_country United Kingdom
customers_telephone 01884860932
customers_email_address xxxxxxxx@hotmail.co.uk
customers_address_format_id 2

delivery_name Some Customer
delivery_company ''
delivery_street_address 10 Some Street
delivery_suburb Some Place
delivery_city Somewhere
delivery_postcode AA1 1AA
delivery_state Devon
delivery_country United Kingdom
delivery_address_format_id 2

billing_name Some Customer
billing_company ''
billing_street_address 10 Some Street
billing_suburb Some Place
billing_city Somewhere

payment_method Other
cc_type ''
cc_owner ''
cc_number ''
cc_expires ''
last_modified 2011-04-20 19:05:18
date_purchased 2011-04-20 12:52:16
orders_status 3
orders_date_finished NULL
currency GBP
currency_value 1.000000
shipping_module rmstandardparcel_rmstandardparcel
customer_service_id ''
discount_codes 1-CaptuRe
?????? ''

For ?????? there is no fieldname, so I think the mistake is near customer_service_id
Last edited by bonbec on Wed Apr 24, 2024 3:49 pm, edited 2 times in total.
User avatar
burt
Core Team
Posts: 4555
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: SQL database problem

Post by burt »

Note:
I have removed this customers details.

It is always wise to anonymize any data.
User avatar
bonbec
Contributor
Posts: 190
Joined: Mon Oct 26, 2020 12:23 pm
Phoenix Version: V1.1.0.7
Has thanked: 54 times
Been thanked: 40 times

Re: SQL database problem

Post by bonbec »

Ok, well seen. I also changed the email address in my post.
Old MS2.2 PHP7.4 site being converted to CE Phoenix v1.1.0.6 PHP 8.3
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Re: SQL database problem

Post by Xpajun »

I actually got this sorted - wasn't the first nor the last - it seems that the database errors point to something around about the line given - I spent all day yesterday working on it - find one and fix and you get another cropping up - hazzards of getting old data into a new database I suppose ;)
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Re: SQL database problem

Post by Xpajun »

burt wrote: Wed Apr 24, 2024 3:20 pm Note:
I have removed this customers details.

It is always wise to anonymize any data.
Thanks Gary brain fuzzed out when I posted
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply