Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

Hello, I am restoring a site after an SSL certificate was added to our site and there are many database syntax errors I am fishing through to get my database back up. This is the one I am having a hard time finding a resolution for:

 

This is the portion of my code:

 

drop table if exists ps_customized_data;

create table ps_customized_data (

id_customization int(10) unsigned not null ,

type tinyint(1) not null ,

index int(3) not null ,

value varchar(255) not null ,

PRIMARY KEY (id_customization, type, index)

);

 

 

and this is the error message I receive when running the backup:

 

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 'int(3) not null ,

value varchar(255) not null ,

PRIMARY KEY (id_customizat' at line 4

Edited by steffanih
Posted

It turns out this did the trick:

 

drop table if exists ps_customization_data;

create table ps_customization_data (

id_customization_data int(10) unsigned not null ,

type tinyint(1) not null ,

id_index int(3) not null ,

id_value varchar(255) not null ,

PRIMARY KEY (id_customization_data, type, id_index)

);

 

so if you're stuck on the same thing I am, here ya go. I ended up having to query in some of the original osCommerce tables to get everything back up and running correctly. My database was only partially backing up. I am almost good to go and may needs some more help on SSL implementation issues.

Posted

#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 'int(3) not null ,

value varchar(255) not null ,

PRIMARY KEY (id_customizat' at line 4

The basic problem is that index is a reserved word in MySQL, basically meaning it shouldn't be used as a column name. You can use it but then all the queries need to put backticks around the "index" name. Simplest way is to avoid it, like you do now to change the name from index to id_index.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...