Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I get myadmin to accept SQL


Ausgirl

Recommended Posts

Hello,

 

Ive been trying forever to get phpmyadmin to accept the SQL code from RMA Returns. When I run it, it says:

 

MySQL said:

 

#1060 - Duplicate column name 'products_returned'

 

Yet in Admin it says its not there.

 

For Returns Status:

 

1146 - Table 'wwwshop_osc1.returns_status' doesn't exist

 

select count(*) as total from returns_status where language_id = '1'

 

Tables that are showing in the database are: refund methods, refund payments, returned products, returned products data, returns status history, returns total, returns reasons, returns text.

 

Could someone please advise on what is wrong here. Its not very nice having a site full of errors.

 

Thanks

Link to comment
Share on other sites

Hello,

 

Ive been trying forever to get phpmyadmin to accept the SQL code from RMA Returns. When I run it, it says:

 

MySQL said:

 

#1060 - Duplicate column name 'products_returned'

 

Yet in Admin it says its not there.

 

For Returns Status:

 

1146 - Table 'wwwshop_osc1.returns_status' doesn't exist

 

select count(*) as total from returns_status where language_id = '1'

 

Tables that are showing in the database are: refund methods, refund payments, returned products, returned products data, returns status history, returns total, returns reasons, returns text.

 

Could someone please advise on what is wrong here. Its not very nice having a site full of errors.

 

Thanks

 

Post the SQL query from RMA you're trying to run.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Hope this is what you mean. I have also put in little comments of ((((WOULD NOT ACCEPT)))) so I would remember which ones didnt work. I had to run each one seperately.

 

phpMyAdmin MySQL-Dump

# version 2.3.2

# http://www.phpmyadmin.net/ (download page)

#

# Host: localhost

# Generation Time: Apr 07, 2003 at 03:11 PM

# Server version: 4.00.12

# PHP Version: 4.2.3

# Database : `rma_osc`

# --------------------------------------------------------

 

#

# Table structure for table `configuration`

#

 

 

INSERT INTO configuration VALUES ('', 'Default charge for restocking a non-faulty item', 'DEFAULT_RESTOCK_VALUE', '12.5', 'This is the charge applied to refund to cover the return of non-faulty items which are to be entered back into stock for resale', 9, NULL, '2003-03-01 15:22:17', '0001-01-01 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Default Return Reason', 'DEFAULT_RETURN_REASON', '2', 'This is the default reason applied to all returns', 6, NULL, '2003-02-27 06:44:29', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Default Return Status', 'DEFAULT_RETURN_STATUS_ID', '1', 'Default return status assigned to all new returns', 6, NULL, '2003-02-28 07:10:04', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Default Refund Method', 'DEFAULT_REFUND_METHOD', '1', 'Default method for refund

payment', 6, NULL, '2003-03-01 16:46:12', '0000-00-00 00:00:00', NULL, NULL);

 

 

 

ALTER TABLE orders_products ADD products_returned tinyint(2) unsigned default '0'; ((((WOULD NOT ACCEPT))))

ALTER TABLE orders_products ADD products_exchanged tinyint(2) NOT NULL default '0';

ALTER TABLE orders_products ADD products_exchanged_id int(11) NOT NULL default '0';

 

 

#

# Table structure for table `refund_method`

#

 

DROP TABLE IF EXISTS refund_method;

CREATE TABLE refund_method (

refund_method_id int(11) NOT NULL default '0',

language_id int(11) NOT NULL default '1',

refund_method_name varchar(32) NOT NULL default '',

PRIMARY KEY (refund_method_id,language_id),

KEY idx_refund_method_name (refund_method_name)

) TYPE=MyISAM;

 

#

# Dumping data for table `refund_method`

#

 

INSERT INTO refund_method VALUES (1, 1, 'Paypal');

INSERT INTO refund_method VALUES (2, 1, 'NoChex');

INSERT INTO refund_method VALUES (3, 1, 'Exchange');

INSERT INTO refund_method VALUES (4, 1, 'Gift Vouchers');

# --------------------------------------------------------

 

#

# Table structure for table `refund_payments`

#

 

DROP TABLE IF EXISTS refund_payments;

CREATE TABLE refund_payments (

refund_payment_id int(11) NOT NULL auto_increment,

returns_id int(11) NOT NULL default '0',

refund_payment_name varchar(64) NOT NULL default 'No Refund Made',

refund_payment_value decimal(15,4) NOT NULL default '0.0000',

refund_payment_date datetime NOT NULL default '0000-00-00 00:00:00',

refund_payment_reference varchar(50) default NULL,

refund_payment_deductions decimal(15,4) NOT NULL default '0.0000',

customer_method varchar(50) NOT NULL default '',

PRIMARY KEY (refund_payment_id)

) TYPE=MyISAM;

 

 

#

# Table structure for table `return_reasons`

#

 

DROP TABLE IF EXISTS return_reasons;

CREATE TABLE return_reasons (

return_reason_id tinyint(3) unsigned NOT NULL default '0',

language_id tinyint(3) unsigned NOT NULL default '1',

return_reason_name varchar(25) default NULL,

PRIMARY KEY (return_reason_id,language_id)

) TYPE=MyISAM;

 

#

# Dumping data for table `return_reasons`

#

 

INSERT INTO return_reasons VALUES (1, 1, 'Faulty');

INSERT INTO return_reasons VALUES (1, 2, '');

INSERT INTO return_reasons VALUES (1, 3, '');

INSERT INTO return_reasons VALUES (2, 1, 'Damaged');

INSERT INTO return_reasons VALUES (2, 2, '');

INSERT INTO return_reasons VALUES (2, 3, '');

INSERT INTO return_reasons VALUES (3, 1, 'Incorrect Item');

INSERT INTO return_reasons VALUES (3, 2, '');

INSERT INTO return_reasons VALUES (3, 3, '');

INSERT INTO return_reasons VALUES (4, 1, 'Warranty');

INSERT INTO return_reasons VALUES (4, 2, '');

INSERT INTO return_reasons VALUES (4, 3, '');

# --------------------------------------------------------

 

#

# Table structure for table `return_text`

#

 

DROP TABLE IF EXISTS return_text;

CREATE TABLE return_text (

return_text_id tinyint(3) unsigned NOT NULL default '0',

language_id tinyint(3) unsigned NOT NULL default '1',

return_text_one text,

PRIMARY KEY (return_text_id,language_id),

KEY status_id (return_text_id)

) TYPE=MyISAM;

 

#

# Dumping data for table `return_text`

#

 

INSERT INTO return_text VALUES (0, 1, 'testing only');

INSERT INTO return_text VALUES (1, 1, 'Thank you for submitting your return request. Please be sure to make a note of the above RMA number, as you will need it to track the progress of your return. We will be in touch soon with further instructions regarding your return request.<br /><br />');

# --------------------------------------------------------

 

#

# Table structure for table `returned_products`

#

 

DROP TABLE IF EXISTS returned_products;

CREATE TABLE returned_products (

returns_id int(11) NOT NULL auto_increment,

customers_id int(11) NOT NULL default '0',

rma_value varchar(15) NOT NULL default '0',

order_id int(11) NOT NULL default '0',

customers_name varchar(64) NOT NULL default '',

customers_acct varchar(32) default NULL,

customers_company varchar(32) default NULL,

customers_street_address varchar(64) NOT NULL default '',

customers_suburb varchar(32) default NULL,

customers_city varchar(32) NOT NULL default '',

customers_postcode varchar(10) NOT NULL default '',

customers_state varchar(32) default NULL,

customers_country varchar(32) NOT NULL default '',

customers_telephone varchar(32) NOT NULL default '',

customers_fax varchar(32) NOT NULL default '',

customers_email_address varchar(96) NOT NULL default '',

customers_address_format_id int(5) NOT NULL default '0',

delivery_name varchar(64) NOT NULL default '',

delivery_company varchar(32) default NULL,

delivery_street_address varchar(64) NOT NULL default '',

delivery_suburb varchar(32) default NULL,

delivery_city varchar(32) NOT NULL default '',

delivery_postcode varchar(10) NOT NULL default '',

delivery_state varchar(32) default NULL,

delivery_country varchar(32) NOT NULL default '',

delivery_address_format_id int(5) NOT NULL default '0',

billing_name varchar(64) NOT NULL default '',

billing_acct varchar(32) default NULL,

billing_company varchar(32) default NULL,

billing_street_address varchar(64) NOT NULL default '',

billing_suburb varchar(32) default NULL,

billing_city varchar(32) NOT NULL default '',

billing_postcode varchar(10) NOT NULL default '',

billing_state varchar(32) default NULL,

billing_country varchar(32) NOT NULL default '',

billing_address_format_id int(5) NOT NULL default '0',

payment_method varchar(64) NOT NULL default '',

cc_type varchar(20) default NULL,

cc_owner varchar(64) default NULL,

cc_number varchar(32) default NULL,

cc_expires varchar(4) default NULL,

cvvnumber char(3) default NULL,

last_modified datetime default NULL,

date_purchased datetime default NULL,

returns_status int(5) NOT NULL default '1',

returns_date_finished datetime NOT NULL default '0000-00-00 00:00:00',

comments text,

currency char(3) default NULL,

currency_value decimal(14,6) default NULL,

account_name varchar(32) NOT NULL default '',

account_number varchar(20) default NULL,

po_number varchar(12) default NULL,

date_finished datetime NOT NULL default '0000-00-00 00:00:00',

returns_reason tinyint(5) unsigned default '0',

contact_user_name varchar(64) NOT NULL default '',

PRIMARY KEY (returns_id)

) TYPE=MyISAM;

 

#

# Dumping data for table `returned_products`

#

 

 

#

# Table structure for table `returns_products_data`

#

 

DROP TABLE IF EXISTS returns_products_data;

CREATE TABLE returns_products_data (

returns_products_id int(11) NOT NULL auto_increment,

returns_id int(11) NOT NULL default '0',

order_id int(11) NOT NULL default '0',

products_id int(11) NOT NULL default '0',

products_model varchar(12) default NULL,

products_name varchar(120) NOT NULL default '',

products_price decimal(15,4) NOT NULL default '0.0000',

products_discount_made decimal(4,2) default NULL,

final_price decimal(15,4) NOT NULL default '0.0000',

products_tax decimal(7,4) NOT NULL default '0.0000',

products_quantity int(2) NOT NULL default '0',

products_serial_number varchar(128) default NULL,

products_returned tinyint(2) unsigned default '0',

products_exchanged tinyint(2) unsigned default '0',

PRIMARY KEY (returns_products_id)

) TYPE=MyISAM;

 

 

 

#

# Table structure for table `returns_status` ((((WOULD NOT ACCEPT))))

#

 

DROP TABLE IF EXISTS returns_status;

CREATE TABLE returns_status (

returns_status_id int(11) NOT NULL default '',

language_id int(11) NOT NULL default '1',

returns_status_name varchar(32) NOT NULL default '',

PRIMARY KEY (returns_status_id,language_id),

KEY idx_returns_status_name (returns_status_name)

) TYPE=MyISAM;

 

#

# Dumping data for table `returns_status`

#

 

INSERT INTO returns_status VALUES (1, 1, 'Pending'); ((((WOULD NOT ACCEPT))))

INSERT INTO returns_status VALUES (2, 1, 'Awaiting Return');

INSERT INTO returns_status VALUES (3, 1, 'Cancelled');

INSERT INTO returns_status VALUES (4, 1, 'Complete');

# --------------------------------------------------------

 

#

# Table structure for table `returns_total`

#

 

DROP TABLE IF EXISTS returns_total;

CREATE TABLE returns_total (

returns_total_id int(10) unsigned NOT NULL auto_increment,

returns_id int(11) NOT NULL default '0',

title varchar(255) NOT NULL default '',

text varchar(255) NOT NULL default '',

value decimal(15,4) NOT NULL default '0.0000',

class varchar(32) NOT NULL default '',

sort_order int(11) NOT NULL default '0',

PRIMARY KEY (returns_total_id),

KEY idx_returns_total_returns_id (returns_id)

) TYPE=MyISAM;

 

#

# Dumping data for table `returns_total`

#

 

#

# Table structure for table `returns_status_history`

#

DROP TABLE IF EXISTS `returns_status_history`;

CREATE TABLE IF NOT EXISTS `returns_status_history` (

`returns_status_history_id` int(11) unsigned NOT NULL auto_increment,

`returns_id` int(11) unsigned NOT NULL default '0',

`returns_status` int(5) unsigned NOT NULL default '0',

`date_added` datetime default NULL,

`customer_notified` int(1) unsigned default '0',

`comments` text,

PRIMARY KEY (`returns_status_history_id`)

) TYPE=MyISAM COMMENT='Return products''s status change history' AUTO_INCREMENT=5 ;

Link to comment
Share on other sites

MySQL said:

 

#1060 - Duplicate column name 'products_returned'

 

Yet in Admin it says its not there.

 

So when you run

ALTER TABLE orders_products ADD products_returned tinyint(2) unsigned default '0';
ALTER TABLE orders_products ADD products_exchanged tinyint(2) NOT NULL default '0';
ALTER TABLE orders_products ADD products_exchanged_id int(11) NOT NULL default '0';

 

You get

#1060 - Duplicate column name 'products_returned'

 

What happens when you run

#
		 # Table structure for table `returns_status` 
		 #

		 DROP TABLE IF EXISTS returns_status;
		 CREATE TABLE returns_status (
		   returns_status_id int(11) NOT NULL default '',
		   language_id int(11) NOT NULL default '1',
		   returns_status_name varchar(32) NOT NULL default '',
		   PRIMARY KEY  (returns_status_id,language_id),
		   KEY idx_returns_status_name (returns_status_name)
		 ) TYPE=MyISAM;

		 #
		 # Dumping data for table `returns_status`
		 #

		 INSERT INTO returns_status VALUES (1, 1, 'Pending');
		 INSERT INTO returns_status VALUES (2, 1, 'Awaiting Return');
		 INSERT INTO returns_status VALUES (3, 1, 'Cancelled');
		 INSERT INTO returns_status VALUES (4, 1, 'Complete');

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

When I run this:

 

ALTER TABLE orders_products ADD products_returned tinyint(2) unsigned default '0';

ALTER TABLE orders_products ADD products_exchanged tinyint(2) NOT NULL default '0';

ALTER TABLE orders_products ADD products_exchanged_id int(11) NOT NULL default '0';

 

I get this:

 

Error

SQL query:

 

ALTER TABLE orders_products ADD products_returned tinyint( 2 ) unsigned default '0';

 

 

 

MySQL said:

 

#1146 - Table 'wwwshop_osc1gzkeygzkeygzkey.orders_products' doesn't exist

 

and when I run this:

 

# Table structure for table `returns_status`

#

 

DROP TABLE IF EXISTS returns_status;

CREATE TABLE returns_status (

returns_status_id int(11) NOT NULL default '',

language_id int(11) NOT NULL default '1',

returns_status_name varchar(32) NOT NULL default '',

PRIMARY KEY (returns_status_id,language_id),

KEY idx_returns_status_name (returns_status_name)

) TYPE=MyISAM;

 

#

# Dumping data for table `returns_status`

#

 

INSERT INTO returns_status VALUES (1, 1, 'Pending');

INSERT INTO returns_status VALUES (2, 1, 'Awaiting Return');

INSERT INTO returns_status VALUES (3, 1, 'Cancelled');

INSERT INTO returns_status VALUES (4, 1, 'Complete');

 

 

SQL query:

 

TABLE structure FOR TABLE `returns_status` #

DROP TABLE IF EXISTS returns_status;

 

 

 

MySQL said:

 

#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 'Table structure for table `returns_status`

 

DROP TABLE IF EXISTS returns_stat' at line 1

 

(Its a different error again or a blank page just shows when I run it)

 

Ive updated my site ages ago if that has anything to do with it.

 

osc1gzkeygzkeygzkey - I dont know what this is, its popped up as another DB but it is empty.

 

On my site the errors pop up on the admin/returns.php?selected_box=returns (1146 - Table 'wwwshop_osc1.returns_status' doesn't exist

 

select returns_status_id, returns_status_name from returns_status where language_id = '1'

 

[TEP STOP]

)

 

and admin/returns.php (1146 - Table 'wwwshop_osc1.returns_status' doesn't exist

 

select returns_status_id, returns_status_name from returns_status where language_id = '1'

 

[TEP STOP]

)

 

and admin/returns_status.php (1146 - Table 'wwwshop_osc1.returns_status' doesn't exist

 

select count(*) as total from returns_status where language_id = '1')

 

and on catalog side:

 

returns_track.php?action=returns_show&rma=return number:(1146 - Table 'wwwshop_osc1.returns_status' doesn't exist

 

SELECT returns_status_name FROM returns_status where returns_status_id = 1 and language_id = '1'

 

[TEP STOP]

 

and

 

return_product.php?action=sent&rma_value=number&return_id=2 (the return number does not show up on the page as it should it only appears in the email.

 

 

I hope I havent confused you. :)

Link to comment
Share on other sites

MySQL said:

 

#1146 - Table 'wwwshop_osc1gzkeygzkeygzkey.orders_products' doesn't exist

 

osc1gzkeygzkeygzkey - I dont know what this is, its popped up as another DB but it is empty.

 

You need to delete this ghost db and make sure when you are running SQL queries that you're running them on the db you want to run them on. Table '...orders_products' doesn't exist is a very specific error- there is no such table in that database.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Also, if you run a SQL query like that and it errors out at line 400 or whatever, all the lines prior to that line will have already executed. So if you try to rerun the same exact query you will get errors because those lines have already been run and the changes implemented in the database.

Link to comment
Share on other sites

Hey djmonkey1

 

Table '...orders_products' doesn't exist is a very specific error- there is no such table in that database.

 

Thats the strange thing, it is there, along with products returned, products exchanged, ect...in the coloums it says Field - products returned, Type - tinyint(2) Attributes - unassigned, NULL - yes, default 0.

 

The tables are there, for some reason it states that it isnt? If I knew how to copy & paste an image of the DB page I would be able to show you so you would know what Im talking about. (but I dont, :()

 

I deleted the other DB with nothing in it. For some reason the DB is not communicating with my site.

 

Which is why when I try & re-run it, I get this error telling me it is there, I get the same error when I run both bits of code (the ones I had ((((WOULD NOT ACCEPT)))) next to):

SQL query:

 

ALTER TABLE orders_products ADD products_returned tinyint( 2 ) unsigned default '0';

MySQL said:

 

#1060 - Duplicate column name 'products_returned'

 

Its so frustrating having only 1/2 a contribution working. I thought maybe I had left something out so went back over the installation, couldnt see anything that I had missed.

 

In the DB it is there, my site says its not there which is when I get this error:

 

1146 - Table 'shop_osc1.returns_status' doesn't exist

 

select returns_status_id, returns_status_name from returns_status where language_id = '1'

 

[TEP STOP]

:blink:

 

You wont see the errors on my site unless you have a return number to place in the box.

 

However there is not any returns_status table:

 

When I run it I get this:

 

SQL query:

 

TABLE structure FOR TABLE `returns_status` #

DROP TABLE IF EXISTS returns_status;

 

 

 

MySQL said:

 

#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 'Table structure for table `returns_status`

 

DROP TABLE IF EXISTS returns_stat' at line 1

Link to comment
Share on other sites

Did you back up your store before adding the SQL statement. The fact the duplicate error showed mean't that it was added before at some point.

 

I have never encountered a problem like this RMA - if you are correct and your site is not talking to the database then yuo need to contact your host and see if they know of any issues with the server...

 

Is there any chance you can remember adding or editing any code from anywhere prior to adding the RMA SQL statement?

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Hello Chooch,

 

I did run the SQL once before and came up with these errors. I then deleted them & started again. I know it says its there, but its not. The last bit of coding/modifing that was done to my site was a little while ago when I had Ultimate SEO installed, but that wouldnt have anything to do with it. Everything was working fine till I tryed to install the RMA SQL. Only part of it would install. I had to run it individually bit by bit. It wouldnt run the whole thing at once. The only thing not working properly is the RMA, everything else works just fine. What Im not understanding is that as you and others have mentioned is that the duplicate error states its been added, yet it is not there. There is no table called returns_status in my DB. This is the strange thing about it.

Link to comment
Share on other sites

Well, you should have backed up your database before adding the RMA statement. If you did, you should revert back to it and start testing from tere. If you didn't back up then I guess you have to make use of what you have.

 

If the table doesn't exist why don't you simply add that single table? Just add the returns_status part of the statement using phpmyadmin and see what happens.

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

I did back up, Ive tried running the single table and I get the 1064 error message as I stated previously, Its only one little table, it should install. Ive already restored and started again. It just wont accept that table for some reason.

Link to comment
Share on other sites

I did back up, Ive tried running the single table and I get the 1064 error message as I stated previously, Its only one little table, it should install. Ive already restored and started again. It just wont accept that table for some reason.

Very strange... as usual there has to be a perfectly simple and logical reason for it. After it is discovered we will all probably wonder why we didn't think of it before, but until then let's try to iscolate the problem.

 

Can you post or PM the store URL?

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

LOL ,I shouldnt laugh, you know, your right, probably just two clicks of the mouse. Anyway, I just ran a repair on my DB and all came up OK. Ill PM you with my addy.

Link to comment
Share on other sites

LOL ,I shouldnt laugh, you know, your right, probably just two clicks of the mouse. Anyway, I just ran a repair on my DB and all came up OK. Ill PM you with my addy.

I just bought a few items so you now need to update the status as sent - once done I will be able to see why you aren't getting the RMA number when customers are returning items.

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Hey djmonkey1

 

Thats the strange thing, it is there, along with products returned, products exchanged, ect...in the coloums it says Field - products returned, Type - tinyint(2) Attributes - unassigned, NULL - yes, default 0.

 

Ack! If the field products_returned is already there, why do you keep running

ALTER TABLE orders_products ADD products_returned tinyint( 2 ) unsigned default '0';

????

 

The tables are there, for some reason it states that it isnt? If I knew how to copy & paste an image of the DB page I would be able to show you so you would know what Im talking about. (but I dont, :( )

 

I deleted the other DB with nothing in it. For some reason the DB is not communicating with my site.

That is not happening. If your DB and site were not talking you would be getting much different errors.

 

Which is why when I try & re-run it, I get this error telling me it is there, I get the same error when I run both bits of code (the ones I had ((((WOULD NOT ACCEPT)))) next to):

SQL query:

 

ALTER TABLE orders_products ADD products_returned tinyint( 2 ) unsigned default '0';

MySQL said:

 

#1060 - Duplicate column name 'products_returned'

This error makes perfect sense; as you've previously stated the field products_returned already exists. It will not do you any good to keep running this command.

 

Its so frustrating having only 1/2 a contribution working. I thought maybe I had left something out so went back over the installation, couldnt see anything that I had missed.

 

In the DB it is there, my site says its not there which is when I get this error:

You are confusing the field "products_returned" which is a column in the orders_products table (a field that does exist in a table that does exist) with the table returns_status (a table that doesn't exist).

 

1146 - Table 'shop_osc1.returns_status' doesn't exist

 

select returns_status_id, returns_status_name from returns_status where language_id = '1'

 

[TEP STOP]

:blink:

 

You wont see the errors on my site unless you have a return number to place in the box.

 

However there is not any returns_status table:

Exactly- that's what the error is telling you.

 

When I run it I get this:

 

SQL query:

 

TABLE structure FOR TABLE `returns_status` #

DROP TABLE IF EXISTS returns_status;

You can not begin a SQL query with

TABLE structure FOR TABLE `returns_status` #

That is not proper syntax and was meant to be a comment. It should be

# TABLE structure FOR TABLE `returns_status`

if used at all. The query you should run to create that table is

DROP TABLE IF EXISTS refund_method;
 CREATE TABLE refund_method (
   refund_method_id int(11) NOT NULL default '0',
   language_id int(11) NOT NULL default '1',
   refund_method_name varchar(32) NOT NULL default '',
   PRIMARY KEY  (refund_method_id,language_id),
   KEY idx_refund_method_name (refund_method_name)
 ) TYPE=MyISAM;

  INSERT INTO refund_method VALUES (1, 1, 'Paypal');
 INSERT INTO refund_method VALUES (2, 1, 'NoChex');
 INSERT INTO refund_method VALUES (3, 1, 'Exchange');
 INSERT INTO refund_method VALUES (4, 1, 'Gift Vouchers');

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I dont keep running it, I was asked what error comes up when I run it so I was trying to explain what errors I get.

 

This is the table that its not accepting, It gives me the 1064 error.

 

Table structure for table `returns_status`

 

 

DROP TABLE IF EXISTS returns_status;

CREATE TABLE returns_status (

returns_status_id int(11) NOT NULL default '',

language_id int(11) NOT NULL default '1',

returns_status_name varchar(32) NOT NULL default '',

PRIMARY KEY (returns_status_id,language_id),

KEY idx_returns_status_name (returns_status_name)

) TYPE=MyISAM;

 

 

Dumping data for table `returns_status`

 

 

INSERT INTO returns_status VALUES (1, 1, 'Pending');

INSERT INTO returns_status VALUES (2, 1, 'Awaiting Return');

INSERT INTO returns_status VALUES (3, 1, 'Cancelled');

INSERT INTO returns_status VALUES (4, 1, 'Complete');

Link to comment
Share on other sites

I dont keep running it, I was asked what error comes up when I run it so I was trying to explain what errors I get.

 

This is the table that its not accepting, It gives me the 1064 error.

 

Table structure for table `returns_status`

 

 

DROP TABLE IF EXISTS returns_status;

CREATE TABLE returns_status (

returns_status_id int(11) NOT NULL default '',

language_id int(11) NOT NULL default '1',

returns_status_name varchar(32) NOT NULL default '',

PRIMARY KEY (returns_status_id,language_id),

KEY idx_returns_status_name (returns_status_name)

) TYPE=MyISAM;

 

 

Dumping data for table `returns_status`

 

 

INSERT INTO returns_status VALUES (1, 1, 'Pending');

INSERT INTO returns_status VALUES (2, 1, 'Awaiting Return');

INSERT INTO returns_status VALUES (3, 1, 'Cancelled');

INSERT INTO returns_status VALUES (4, 1, 'Complete');

 

The lines that would generate syntax errors in the query above are

Table structure for table `returns_status`

and

Dumping data for table `returns_status`

 

If you run that query as posted you will get this error:

#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 'Table structure for table `returns_status`

 

DROP TABLE IF EXISTS returns_sta' at line 1

which is exactly the error you've been getting. The query you need to run was in my last post:
DROP TABLE IF EXISTS refund_method;
	  CREATE TABLE refund_method (
		refund_method_id int(11) NOT NULL default '0',
		language_id int(11) NOT NULL default '1',
		refund_method_name varchar(32) NOT NULL default '',
		PRIMARY KEY  (refund_method_id,language_id),
		KEY idx_refund_method_name (refund_method_name)
	  ) TYPE=MyISAM;

	INSERT INTO refund_method VALUES (1, 1, 'Paypal');
	  INSERT INTO refund_method VALUES (2, 1, 'NoChex');
	  INSERT INTO refund_method VALUES (3, 1, 'Exchange');
	  INSERT INTO refund_method VALUES (4, 1, 'Gift Vouchers');

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I ran that code, it was accepted but I still get the errors in admin stating that the table does not exist:

 

1146 - Table 'shop_osc1.returns_status' doesn't exist

 

select count(*) as total from returns_status where language_id = '1'

 

[TEP STOP]

Link to comment
Share on other sites

I have this in my admin/includes/database_tables.php

 

// RMA Returns System

define('TABLE_RETURN_REASONS', 'return_reasons');

define('TABLE_RETURNS', 'returned_products');

define('TABLE_RETURNS_STATUS', 'returns_status');

define('TABLE_RETURNS_TEXT', 'return_text');

define('TABLE_RETURNS_TOTAL', 'returns_total');

define('TABLE_RETURNS_PRODUCTS_DATA', 'returns_products_data');

define('TABLE_PAYMENT_OPTIONS', 'payment_options');

define('TABLE_RETURN_PAYMENTS', 'refund_payments');

define('TABLE_REFUND_METHOD', 'refund_method');

define('TABLE_RETURNS_STATUS_HISTORY', 'returns_status_history');

 

and this in my catalog/includes/database_tables.php

 

// Begin RMA Returns System

define('TABLE_RETURN_REASONS', 'return_reasons');

define('TABLE_RETURNS', 'returned_products');

define('TABLE_RETURNS_STATUS', 'returns_status');

define('TABLE_RETURNS_TEXT', 'return_text');

define('TABLE_RETURNS_TOTAL', 'returns_total');

define('TABLE_RETURNS_PRODUCTS_DATA', 'returns_products_data');

define('TABLE_RETURN_PAYMENTS', 'refund_payments');

define('TABLE_REFUND_METHOD', 'refund_method');

define('TABLE_RETURNS_STATUS_HISTORY', 'returns_status_history');

// End RMA Returns System

 

I still get the 1146 error, anyone know as to why?

Link to comment
Share on other sites

I ran that code, it was accepted but I still get the errors in admin stating that the table does not exist:

 

1146 - Table 'shop_osc1.returns_status' doesn't exist

 

select count(*) as total from returns_status where language_id = '1'

 

[TEP STOP]

 

Now I'm stumped. It isn't your database tables file. Do you get the same error on the catalog side?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Stumped! Lol, this why Ive had a hard time explaining it. Only if you click on the return number (url is track return.php) I get errors on admin side when I click on the customer return heading so then I have to hit the back button (on browser) then it opens up the sub headings, all of those work except return status. On the catalog side if you click on the return number to see what is happening with it you get the error. When you are applying for a return all is good and works fine except it states the return number for you to write down yet no number shows, yet the number is emailed to you.

 

(Ive probably confused you even more now) :wacko:

Link to comment
Share on other sites

I have returned a test item and I do see the return number error.

 

Can you login to your store and go to the tools box and then get your server details:

 

i) Which verison php is running?

ii) Which verison MySQL is running?

 

I think I have a partial fix.

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...