Jump to content

Archived

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

sackling

help updating database

Recommended Posts

I have a current live site which has continued to function while I updated my website/database on my computer.

 

I am trying to import a few tables from the live site into the database running on my computer to no avail. I want to update the database on my computer because there has been new customers and new orders since I started working on it.

 

so I went to export the tables I wanted to import and went to import the address book as follows:

 

-- phpMyAdmin SQL Dump
-- version 3.3.7
-- http://www.phpmyadmin.net
--
-- Host: mysql.mysite.com
-- Generation Time: Jan 12, 2011 at 11:29 AM
-- Server version: 5.0.67
-- PHP Version: 5.2.15

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `mysite`
--

-- --------------------------------------------------------

--
-- Table structure for table `address_book`
--

CREATE TABLE IF NOT EXISTS `address_book` (
 `address_book_id` int(11) NOT NULL auto_increment,
 `customers_id` int(11) NOT NULL default '0',
 `entry_gender` char(1) NOT NULL,
 `entry_company` varchar(32) default NULL,
 `entry_firstname` varchar(32) NOT NULL,
 `entry_lastname` varchar(32) NOT NULL,
 `entry_street_address` varchar(64) NOT NULL,
 `entry_suburb` varchar(32) default NULL,
 `entry_postcode` varchar(10) NOT NULL,
 `entry_city` varchar(32) NOT NULL,
 `entry_state` varchar(32) default NULL,
 `entry_country_id` int(11) NOT NULL default '0',
 `entry_zone_id` int(11) NOT NULL default '0',
 PRIMARY KEY  (`address_book_id`),
 KEY `idx_address_book_customers_id` (`customers_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1752 ;

--
-- Dumping data for table `address_book`
--

UPDATE `address_book` (`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firstname`, `entry_lastname`, `entry_street_address`, `entry_suburb`, `entry_postcode`, `entry_city`, `entry_state`, `entry_country_id`, `entry_zone_id`) VALUES
(103, 77, '', NULL, 'jake', 'jackson', 'test street', '', '90210', 'test', '', 38, 74),

 

obviously there are a lot more entries.

 

anyways the error I am getting when importing this is:

#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 '(`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firs' at line 4

 

what am I doing wrong?

Share this post


Link to post
Share on other sites

I have a current live site which has continued to function while I updated my website/database on my computer.

 

I am trying to import a few tables from the live site into the database running on my computer to no avail. I want to update the database on my computer because there has been new customers and new orders since I started working on it.

 

so I went to export the tables I wanted to import and went to import the address book as follows:

 

-- phpMyAdmin SQL Dump
-- version 3.3.7
-- http://www.phpmyadmin.net
--
-- Host: mysql.mysite.com
-- Generation Time: Jan 12, 2011 at 11:29 AM
-- Server version: 5.0.67
-- PHP Version: 5.2.15

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `mysite`
--

-- --------------------------------------------------------

--
-- Table structure for table `address_book`
--

CREATE TABLE IF NOT EXISTS `address_book` (
 `address_book_id` int(11) NOT NULL auto_increment,
 `customers_id` int(11) NOT NULL default '0',
 `entry_gender` char(1) NOT NULL,
 `entry_company` varchar(32) default NULL,
 `entry_firstname` varchar(32) NOT NULL,
 `entry_lastname` varchar(32) NOT NULL,
 `entry_street_address` varchar(64) NOT NULL,
 `entry_suburb` varchar(32) default NULL,
 `entry_postcode` varchar(10) NOT NULL,
 `entry_city` varchar(32) NOT NULL,
 `entry_state` varchar(32) default NULL,
 `entry_country_id` int(11) NOT NULL default '0',
 `entry_zone_id` int(11) NOT NULL default '0',
 PRIMARY KEY  (`address_book_id`),
 KEY `idx_address_book_customers_id` (`customers_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1752 ;

--
-- Dumping data for table `address_book`
--

UPDATE `address_book` (`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firstname`, `entry_lastname`, `entry_street_address`, `entry_suburb`, `entry_postcode`, `entry_city`, `entry_state`, `entry_country_id`, `entry_zone_id`) VALUES
(103, 77, '', NULL, 'jake', 'jackson', 'test street', '', '90210', 'test', '', 38, 74),

 

obviously there are a lot more entries.

 

anyways the error I am getting when importing this is:

#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 '(`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firs' at line 4

 

what am I doing wrong?

 

 

Look at your query around or at the 4th line - it should be as the first line here but there is a problem where the second entry here (4th line) ends:

(`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firstname`, `entry_lastname`, `entry_street_address`, `entry_suburb`, `entry_postcode`, `entry_city`, `entry_state`, `entry_country_id`, `entry_zone_id`) VALUES
(`address_book_id`, `customers_id`, `entry_gender`, `entry_company`, `entry_firs


My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 )

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Share this post


Link to post
Share on other sites

×