hi, i often find myself copying (exporting) tables from one site (database) to another. I export the table in phpMyAdmin using the export SQL. I then copy the code exported and paste it into the an SQL query on the other site in phpMyAdmin, however i was wondering is it necessary to copy and paste all of the code that is exported. Do i need to copy and paste the code below between the HERE and HERE tags. Thanks for your help HERE -- phpMyAdmin SQL Dump -- version 2.10.0.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Sep 28, 2007 at 10:52 AM -- Server version: 5.0.27 -- PHP Version: 4.4.4 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `database_database` -- -- -------------------------------------------------------- -- -- Table structure for table `accounts` -- HERE CREATE TABLE `accounts` ( `id` int(8) NOT NULL auto_increment, `firstname` char(20) NOT NULL, `lastname` char(20) NOT NULL, `username` varchar(20) NOT NULL, etc...
All lines that begin with two dashes (-) are comments and are not necessary. However, what I do is just put the cursor in the text area and click CTRL + A to select all text and then CTRL + C to copy it. It's way faster than selecting and copying the text manually.
Ok thanks... but there is one line without the two dashes (-). Is that important SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
This is from dev.mysql.com: http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html So it's up to you and your table structure, whether you want to use it or not.