Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

sql database error


moggs

Recommended Posts

When attempting to add custom fields to customer details I've somehow deleted the 'customers' from my database in mysql database via phpmyadmin!

 

I've tried reading through the forums and phpmyadmin documents but can't seem to find the answer. Could you please advise me how I can fix this problem, would I be best served reinstalling oscommerce as an update and hopefully the missing field will be replaced or what would you suggest :blink:

 

 

This is the message that shows in Admin after logging on -

Customers Date

1146 - Table 'sportzal_new.customers' doesn't exist

 

select c.customers_id, c.customers_lastname, c.customers_firstname, ci.customers_info_date_account_created from customers c, customers_info ci where c.customers_id = ci.customers_info_id order by ci.customers_info_date_account_created desc limit 6

 

[TEP STOP]

Link to comment
Share on other sites

Do you have any backup? If yes, just import the database. If not, the following from default may help you

 

-- phpMyAdmin SQL Dump
-- version 2.11.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
CREATE TABLE IF NOT EXISTS `customers` (
 `customers_id` int(11) NOT NULL auto_increment,
 `customers_gender` char(1) NOT NULL,
 `customers_firstname` varchar(32) NOT NULL,
 `customers_lastname` varchar(32) NOT NULL,
 `customers_dob` datetime NOT NULL default '0000-00-00 00:00:00',
 `customers_email_address` varchar(96) NOT NULL,
 `customers_default_address_id` int(11) default NULL,
 `customers_telephone` varchar(32) NOT NULL,
 `customers_fax` varchar(32) default NULL,
 `customers_password` varchar(40) NOT NULL,
 `customers_newsletter` char(1) default NULL,
 PRIMARY KEY  (`customers_id`),
 KEY `idx_customers_email_address` (`customers_email_address`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2;

--
-- Dumping data for table `customers`
--

INSERT INTO `customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `customers_dob`, `customers_email_address`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `customers_password`, `customers_newsletter`) VALUES
(1, 'm', 'John', 'doe', '2001-01-01 00:00:00', 'root@localhost', 1, '12345', '', 'd95e8fa7f20a009372eb3477473fcd34:1c', '0');

 

Simple copy the whole text between code - in notepad.

Give any name (customer_table.sql) and save the file.

Go to phpmyadmin and use import option to recreate the table.

 

This would not give back customer data that is lost.. it would just recreate the table for you, and populate with standard dummy data that ships with OSC installation.

 

You can delete insert into - lines from the code if you don't wish to populate dummy data.

 

HTH

Best Regards,
Gaurav

Link to comment
Share on other sites

Cheers Your a Star!!

 

I Really appreciate your taking the time to answer - Even I managed to understand what to do and it worked a treat!

 

Valuable lesson learned, back up, back up, back up and back up again before going near the database :)

 

:rolleyes:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...