Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trouble editing SQL


Guest

Recommended Posts

Hi,

 

I have installed a date picker plug-in which requires a SQL change.

 

The instructions are simply this:

 

ALTER TABLE `orders` ADD `delivery_date` DATETIME NOT NULL AFTER `delivery_address_format_id` ;

 

When I open 'orders' table I see:

 

SELECT * FROM `orders` WHERE 1

 

So I make the amendment to show:

 

SELECT * FROM `orders` WHERE 1

ADD `delivery_date` DATETIME NOT NULL AFTER `delivery_address_format_id` ;

 

But 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 'ADD `delivery_date` DATETIME NOT NULL AFTER `delivery_address_format_id` LIMIT' at line 2

 

I have also tried the same line minus the ADD command. Not much support from the plug-in guy on this, any ideas on what this could be??

 

Any help gratefully received :)

 

Many TIA

Link to comment
Share on other sites

Don't select any table, just the database and then use just the statement the addon is telling you, nothing else.

ALTER TABLE `orders` ADD `delivery_date` DATETIME NOT NULL AFTER `delivery_address_format_id` ;

 

For more info, look here

Link to comment
Share on other sites

SELECT * FROM `orders` WHERE 1

is simply a dummy filler to give you a hint as to where to write your SQL query. You have to erase it before typing in the full ALTER... command.

 

If you have absolutely no idea what you're doing, I would suggest hiring someone who does, to do it for you. You're going to really screw up your database blindly entering SQL queries in a helter-skelter manner. Unlike code changes, it's a lot harder to back out an error in a database. At the very least you should be taking a full backup of your database before you start experimenting (and confirm that it's a good backup and know how to properly restore it!).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...