Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MySQL Error urgent pls help

    Hi there,

    My host performed an upgrade to MySQL version 5 this morning and now my website displays the following error:

    Database Class: MySQL Error : Duplicate entry '2009-02-25-11-31-1' for key 1

    I have very little knowledge of MySQL and use SQLyog to view the database contents. Before the upgrade I performed a back-up of the database. Any ideas of what may need to be changed, I need to get it going asap. The host has been been quite unhelpful about this.

    many thanks in advance
    ______________

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Either that key (which looks like a modified date/time) is already in the table you're trying to put it in, or there could be a table index issue as mentioned here a few posts down.
    Are you a Help Vampire?

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,108
    Thanks
    2
    Thanked 326 Times in 318 Posts
    If your database backup is a .sql file, could find and post the table definition that is in the backup file and post the current table definition after the upgrade. Post at least one row of data from the backup as an example of what is in the table. xxxxxxx out any sensitive information but don't change any of the syntax or punctuation. Also, what exact major/minor version was the database before the upgrade and what exact major/minor version is it now.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #4
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by CFMaBiSmAd View Post
    If your database backup is a .sql file, could find and post the table definition that is in the backup file and post the current table definition after the upgrade. Post at least one row of data from the backup as an example of what is in the table. xxxxxxx out any sensitive information but don't change any of the syntax or punctuation. Also, what exact major/minor version was the database before the upgrade and what exact major/minor version is it now.
    Hi, many thanks for the reply. Before the upgrade it was MySQL - 4.1.22 and now it's version MySQL - 5.0.45. However I'm not sure which table is the problem. What I'm trying to do now is creating new database with the tables in php MyAdmin (part of XAMPP download) and then repopulating it with the data. Would this work? Thanks soooo much

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,108
    Thanks
    2
    Thanked 326 Times in 318 Posts
    Either your table got altered to add a UNIQUE INDEX for that column (which is unlikely) or you already had a UNIQUE INDEX and your data was altered so that you now have duplicate value(s) or your code started attempting to put in duplicate values (which is possible) or the database strict mode setting got changed so that an error condition that was always occurring but was being ignored before is now generating a fatal error (which is very possible.)

    I would ask your host what the STRICT SQL mode is set to.

    You do need to find and fix the problem. If you have a UNIQUE INDEX because the data is supposed to be UNIQUE, your code needs to either test if you are attempting to insert duplicate values or if you are letting the database tell you by returning an duplicate index error, your code needs to detect this and take appropriate action.

    We cannot specifically help you without knowing what your table was and is now, what your data looks like, or what the code is that produced the error.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by CFMaBiSmAd View Post
    Either your table got altered to add a UNIQUE INDEX for that column (which is unlikely) or you already had a UNIQUE INDEX and your data was altered so that you now have duplicate value(s) or your code started attempting to put in duplicate values (which is possible) or the database strict mode setting got changed so that an error condition that was always occurring but was being ignored before is now generating a fatal error (which is very possible.)

    I would ask your host what the STRICT SQL mode is set to.

    You do need to find and fix the problem. If you have a UNIQUE INDEX because the data is supposed to be UNIQUE, your code needs to either test if you are attempting to insert duplicate values or if you are letting the database tell you by returning an duplicate index error, your code needs to detect this and take appropriate action.

    We cannot specifically help you without knowing what your table was and is now, what your data looks like, or what the code is that produced the error.
    Hi,

    Thanks so much for your patience and help. Just spoken with my hosting company and asked them what the STRICT SQL mode is set to, but they say that's they haven't come across that, which is very peculiar. I'm just going through the SQL dump of the database yesterday and the database today and taking out sensitive data, so I'll be posting it shortly. Would that be ok? THANK YOU

  • #7
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's the Database back up yesterday 24/2/09 before the upgrade (all sensitive data has been taken out, just example data left)

    /*
    SQLyog Community Edition- MySQL GUI v7.11
    MySQL - 4.1.22-standard-log : Database - testdb
    *********************************************************************
    */


    /*!40101 SET NAMES utf8 */;

    /*!40101 SET SQL_MODE=''*/;

    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

    CREATE DATABASE /*!32312 IF NOT EXISTS*/`testdb` /*!40100 DEFAULT CHARACTER SET latin1 */;

    USE `testdb`;

    /*Table structure for table `tbAdBanners` */

    DROP TABLE IF EXISTS `tbAdBanners`;

    CREATE TABLE `tbAdBanners` (
    `banner_id` mediumint(9) NOT NULL auto_increment,
    `client_id` mediumint(9) NOT NULL default '0',
    `banner_active` enum('t','f') NOT NULL default 't',
    `banner_image` varchar(255) NOT NULL default '',
    `cache_html` blob NOT NULL,
    `banner_width` smallint(6) NOT NULL default '0',
    `banner_height` smallint(6) NOT NULL default '0',
    `banner_seq` tinyint(4) NOT NULL default '0',
    `banner_url` varchar(255) NOT NULL default '',
    `banner_alt` varchar(255) NOT NULL default '',
    `banner_description` varchar(255) NOT NULL default '',
    PRIMARY KEY (`banner_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdBanners` */

    insert into `tbAdBanners`(`banner_id`,`client_id`,`banner_active`,`banner_image`,`cache_html`,`banner_width`,`ba nner_height`,`banner_seq`,`banner_url`,`banner_alt`,`banner_description`) values (1,1,'t','ad001-01.gif','<a href=\"{urlprefix}ads/adclick.php?bannerid={bannerid}&loc={loc}&dest=http://www.test.co.uk/index.php\" target=\"_blank\"><img src=\"{urlprefix}images/ads/ad001-02.gif\" width=\"468\" height=\"60\" alt=\"Advertise with us\" title=\"(opens in new window)\" border=\"0\"></a>',468,60,0,'http://www.test.co.uk/index.php','Advertise with us','advert');

    /*Table structure for table `tbAdCache` */

    DROP TABLE IF EXISTS `tbAdCache`;

    CREATE TABLE `tbAdCache` (
    `cache_id` varchar(255) NOT NULL default '',
    `cache_content` blob NOT NULL,
    PRIMARY KEY (`cache_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdCache` */

    insert into `tbAdCache`(`cache_id`,`cache_content`) values ('loc=zone:2','a:3:{i:0;i:2;i:1;a:4:{i:0;a:19:{i:0;s:2:\"29\";s:8:\"bannerid\";s:2:\"29\";i:1;s:2:\" 13\";s:8:\"clientid\";s:2:\"13\";i:2;s:13:\"ad013-01.gif\";s:5:\"image\";s:12:\"ad018-01.jpg\";i:3;s:32:\"http://www.myspace.com/yovamusic\";s:3:\"url\";s:32:\"http://www.myspace.com/yovamusic\";i:4;s:310:\"<a href=\"{urlprefix}ads/adclick.php?bannerid={bannerid}&loc={loc}&dest=http://www.myspace.com/yovamusic\" target=\"_blank\"><img src=\"{urlprefix}images/ads/ad018-01.jpg\" width=\"468\" height=\"60\" alt=\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\" title=\"(opens in new window)\" border=\"0\"></a>\";s:9:\"htmlcache\";s:310:\"<a href=\"{urlprefix}ads/adclick.php?bannerid={bannerid}&loc={loc}&dest=http://www.myspace.com/yovamusic\" target=\"_blank\"><img src=\"{urlprefix}images/ads/ad018-01.jpg\" width=\"468\" height=\"60\" alt=\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\" title=\"(opens in new window)\" border=\"0\"></a>\";i:5;s:3:\"468\";s:5:\"width\";s:3:\"468\";i:6;s:2:\"60\";s:6:\"height\";s:2:\"60\";i:7;s:1:\"0\ ";s:3:\"seq\";s:1:\"0\";i:8;s:67:\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\";s:3:\"alt\";s:67:\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\";s:10:\"banner_seq\";i:0;}}i:2;s:14:\"12,34,35,42,44\";}');

    /*Table structure for table `tbAdClicks` */

    DROP TABLE IF EXISTS `tbAdClicks`;

    CREATE TABLE `tbAdClicks` (
    `banner_id` mediumint(9) NOT NULL default '0',
    `ad_totalclicks` mediumint(100) default NULL,
    `click_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    KEY `date` (`click_date`),
    KEY `banner_date` (`banner_id`,`click_date`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdClicks` */

    insert into `tbAdClicks`(`banner_id`,`ad_totalclicks`,`click_date`) values (1,2,'2006-07-05 00:00:00'),(2,0,'2006-07-05 00:00:00'),(1,0,'2006-07-06 00:00:00');

    /*Table structure for table `tbAdClients` */

    DROP TABLE IF EXISTS `tbAdClients`;

    CREATE TABLE `tbAdClients` (
    `client_id` mediumint(9) NOT NULL auto_increment,
    `client_name` varchar(255) NOT NULL default '',
    `client_email` varchar(255) NOT NULL default '',
    `client_expire` date default '0000-00-00',
    `client_active` enum('t','f') NOT NULL default 't',
    `client_reportlast` date NOT NULL default '0000-00-00',
    PRIMARY KEY (`client_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdClients` */

    insert into `tbAdClients`(`client_id`,`client_name`,`client_email`,`client_expire`,`client_active`,`client_repor tlast`) values (20,'Retreats','me@retreats.co.uk','2009-04-04','t','2008-07-31'),(22,'Tour DVD','surfer@aol.com','2008-08-27','t','0000-00-00');

    /*Table structure for table `tbAdStats` */

    DROP TABLE IF EXISTS `tbAdStats`;

    CREATE TABLE `tbAdStats` (
    `ad_views` int(11) NOT NULL default '0',
    `ad_clicks` int(11) NOT NULL default '0',
    `ad_day` date NOT NULL default '0000-00-00',
    `ad_hour` tinyint(4) NOT NULL default '0',
    `banner_id` smallint(6) NOT NULL default '0',
    `zone_id` smallint(6) NOT NULL default '0',
    PRIMARY KEY (`ad_day`,`ad_hour`,`banner_id`,`zone_id`),
    KEY `banner_day` (`banner_id`,`ad_day`),
    KEY `zoneid` (`zone_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdStats` */

    insert into `tbAdStats`(`ad_views`,`ad_clicks`,`ad_day`,`ad_hour`,`banner_id`,`zone_id`) values (2,0,'2009-02-23',19,31,14),(10,2,'2009-02-23',11,15,15),(3,0,'2009-02-23',23,44,25),(3,0,'2009-02-23',11,19,13);

    /*Table structure for table `tbAdViews` */

    DROP TABLE IF EXISTS `tbAdViews`;

    CREATE TABLE `tbAdViews` (
    `banner_id` mediumint(9) NOT NULL default '0',
    `ad_totalviews` mediumint(100) default NULL,
    `view_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    KEY `date` (`view_date`),
    KEY `banner_date` (`banner_id`,`view_date`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdViews` */

    insert into `tbAdViews`(`banner_id`,`ad_totalviews`,`view_date`) values (1,27,'2006-07-05 00:00:00'),(2,13,'2006-07-05 00:00:00'),(44,187,'2009-02-22 00:00:00'),(45,204,'2009-02-22 00:00:00');

    /*Table structure for table `tbAdZones` */

    DROP TABLE IF EXISTS `tbAdZones`;

    CREATE TABLE `tbAdZones` (
    `zone_id` mediumint(9) NOT NULL auto_increment,
    `zone_name` varchar(245) NOT NULL default '',
    `zone_banners` varchar(100) default NULL,
    `zone_active` smallint(6) NOT NULL default '0',
    `zone_width` smallint(6) NOT NULL default '0',
    `zone_height` smallint(6) NOT NULL default '0',
    PRIMARY KEY (`zone_id`),
    KEY `zonenameid` (`zone_name`,`zone_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=31 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdZones` */

    insert into `tbAdZones`(`zone_id`,`zone_name`,`zone_banners`,`zone_active`,`zone_width`,`zone_height`) values (1,'hometop','29,31,37,42',1,468,60),(2,'servicestop','29,31,35,42',0,468,60),(3,'leisuretop','15,25 ,35,42,44',0,468,60);

    /*Table structure for table `tbAdmin` */

    DROP TABLE IF EXISTS `tbAdmin`;

    CREATE TABLE `tbAdmin` (
    `admin_id` smallint(10) NOT NULL auto_increment,
    `admin_user` varchar(100) NOT NULL default '',
    `admin_pass` varchar(100) NOT NULL default '',
    `admin_level` tinyint(4) NOT NULL default '0',
    PRIMARY KEY (`admin_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdmin` */

    insert into `tbAdmin`(`admin_id`,`admin_user`,`admin_pass`,`admin_level`) values (1,'user1','pass1',1),(2,'user2','pass2',1);

    /*Table structure for table `tbCompEntry` */

    DROP TABLE IF EXISTS `tbCompEntry`;

    CREATE TABLE `tbCompEntry` (
    `compentry_id` smallint(6) NOT NULL auto_increment,
    `comp_id` smallint(6) NOT NULL default '0',
    `compentry_answer` varchar(100) NOT NULL default '???',
    `compentry_business` varchar(255) default NULL,
    `compentry_title` varchar(20) NOT NULL default '???',
    `compentry_first` varchar(100) NOT NULL default '???',
    `compentry_last` varchar(100) NOT NULL default '???',
    `compentry_dob` varchar(100) default NULL,
    `compentry_street` varchar(255) NOT NULL default '???',
    `compentry_town` varchar(255) NOT NULL default '???',
    `compentry_pcode` varchar(20) NOT NULL default '???',
    `compentry_phone` varchar(20) NOT NULL default '???',
    `compentry_email` varchar(100) NOT NULL default '???',
    `compentry_info` varchar(20) NOT NULL default 'no',
    `compentry_terms` varchar(20) NOT NULL default 'yes',
    `compentry_date` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY (`compentry_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=1900 DEFAULT CHARSET=latin1;

    /*Data for the table `tbCompEntry` */

    insert into `tbCompEntry`(`compentry_id`,`comp_id`,`compentry_answer`,`compentry_business`,`compentry_title`,`co mpentry_first`,`compentry_last`,`compentry_dob`,`compentry_street`,`compentry_town`,`compentry_pcode `,`compentry_phone`,`compentry_email`,`compentry_info`,`compentry_terms`,`compentry_date`) values (1899,2,'going well','company','Mr','Mr','someone','27/03/67','Road','wW343','555555','test@yahoo.co.uk','','yes','2008-11-06 12:13:28');

    /*Table structure for table `tbEvent` */

    DROP TABLE IF EXISTS `tbEvent`;

    CREATE TABLE `tbEvent` (
    `event_id` mediumint(9) NOT NULL auto_increment,
    `event_title` varchar(255) NOT NULL default '',
    `event_description` mediumtext,
    `event_startdate` datetime default '0000-00-00 00:00:00',
    `event_enddate` datetime default '0000-00-00 00:00:00',
    `event_starttime` varchar(100) default NULL,
    `event_endtime` varchar(100) default NULL,
    `event_months` varchar(50) default NULL,
    `event_website` varchar(255) default NULL,
    `event_venue` mediumtext,
    `event_phone` varchar(20) default NULL,
    `event_email` varchar(100) default NULL,
    `event_active` tinyint(4) NOT NULL default '0',
    PRIMARY KEY (`event_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=626 DEFAULT CHARSET=latin1;

    /*Data for the table `tbEvent` */

    insert into `tbEvent`(`event_id`,`event_title`,`event_description`,`event_startdate`,`event_enddate`,`event_star ttime`,`event_endtime`,`event_months`,`event_website`,`event_venue`,`event_phone`,`event_email`,`eve nt_active`) values (623,'Wedding Fayre','','2009-02-15 00:00:00','2009-02-15 00:00:00','10.30am','4.30pm','2','','','','',1);

    /*Table structure for table `tbLaunch` */

    DROP TABLE IF EXISTS `tbLaunch`;

    CREATE TABLE `tbLaunch` (
    `launch_email` varchar(255) NOT NULL default '',
    `launch_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbLaunch` */

    insert into `tbLaunch`(`launch_email`,`launch_date`) values ('test@yahoo.com','2006-05-01 11:28:19');

    /*Table structure for table `tbListCategory` */

    DROP TABLE IF EXISTS `tbListCategory`;

    CREATE TABLE `tbListCategory` (
    `listcat_id` smallint(150) unsigned NOT NULL auto_increment,
    `section_id` tinyint(10) NOT NULL default '0',
    `listcat_name` varchar(30) NOT NULL default '',
    PRIMARY KEY (`listcat_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=106 DEFAULT CHARSET=latin1;

    /*Data for the table `tbListCategory` */

    insert into `tbListCategory`(`listcat_id`,`section_id`,`listcat_name`) values (1,1,'building'),(2,1,'legal'),(3,5,'education'),(4,6,'pubs & bars');

    /*Table structure for table `tbListSubcategory` */

    DROP TABLE IF EXISTS `tbListSubcategory`;

    CREATE TABLE `tbListSubcategory` (
    `listsubcat_id` mediumint(150) unsigned NOT NULL auto_increment,
    `listcat_id` smallint(10) NOT NULL default '0',
    `listsubcat_name` varchar(30) NOT NULL default '',
    `listcat_name` varchar(255) default NULL,
    `section_name` varchar(255) NOT NULL default '',
    `listsubcat_key` mediumtext,
    PRIMARY KEY (`listsubcat_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=360 DEFAULT CHARSET=latin1 COMMENT='listing subcategories';

    /*Data for the table `tbListSubcategory` */

    insert into `tbListSubcategory`(`listsubcat_id`,`listcat_id`,`listsubcat_name`,`listcat_name`,`section_name`,`li stsubcat_key`) values (1,2,'solictors','legal','services','solicitors, legal aid, lawyer'),(2,1,'builders','building','services','building, build'),(3,1,'plumbers','building','services','plumbing, plumbers, heating engineers, gas installers, gas instalers, gas fitters, gas fiters, heating/plumbing, plumbing/heating');

    /*Table structure for table `tbListings` */

    DROP TABLE IF EXISTS `tbListings`;

    CREATE TABLE `tbListings` (
    `listing_id` smallint(5) unsigned NOT NULL auto_increment,
    `listing_name` varchar(60) NOT NULL default '',
    `listing_street` varchar(50) default NULL,
    `listing_town` varchar(30) default NULL,
    `listing_postcode` varchar(10) default NULL,
    `listing_phone` varchar(15) default NULL,
    `listing_email` varchar(50) default NULL,
    `listing_website` varchar(50) default NULL,
    `listing_cat` tinyint(4) unsigned default NULL,
    `listing_subcat01` smallint(3) unsigned default NULL,
    `listing_subcat02` smallint(3) unsigned default NULL,
    `listing_page` mediumint(5) unsigned default NULL,
    PRIMARY KEY (`listing_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=2292 DEFAULT CHARSET=latin1 COMMENT='site listings';

    /*Data for the table `tbListings` */

    insert into `tbListings`(`listing_id`,`listing_name`,`listing_street`,`listing_town`,`listing_postcode`,`listing _phone`,`listing_email`,`listing_website`,`listing_cat`,`listing_subcat01`,`listing_subcat02`,`listi ng_page`) values (1,'My Business','30 Crescent','','','01638 555555',NULL,NULL,10,9,NULL,NULL);

    /*Table structure for table `tbPollAnswer` */

    DROP TABLE IF EXISTS `tbPollAnswer`;

    CREATE TABLE `tbPollAnswer` (
    `poll_id` int(11) NOT NULL default '0',
    `poll_answer` varchar(50) NOT NULL default '',
    `poll_votecount` int(11) NOT NULL default '0',
    `poll_voteid` int(11) NOT NULL default '0',
    `poll_status` varchar(6) default NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbPollAnswer` */

    insert into `tbPollAnswer`(`poll_id`,`poll_answer`,`poll_votecount`,`poll_voteid`,`poll_status`) values (1,'Fistral',4,1,NULL),(1,'Tolcarne',4,2,NULL),(1,'Towan',3,3,NULL),(2,'No',1,3,NULL),(2,'Maybe',2,2 ,NULL),(2,'Yes',2,1,NULL);

    /*Table structure for table `tbPollCheck` */

    DROP TABLE IF EXISTS `tbPollCheck`;

    CREATE TABLE `tbPollCheck` (
    `poll_id` tinyint(5) NOT NULL default '0',
    `poll_voteip` varchar(20) NOT NULL default '',
    `poll_votetime` varchar(14) NOT NULL default '',
    PRIMARY KEY (`poll_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbPollCheck` */

    insert into `tbPollCheck`(`poll_id`,`poll_voteip`,`poll_votetime`) values (0,'81.155.65.15','1235410979');

    /*Table structure for table `tbPollQuestion` */

    DROP TABLE IF EXISTS `tbPollQuestion`;

    CREATE TABLE `tbPollQuestion` (
    `poll_id` int(11) NOT NULL default '0',
    `poll_question` varchar(150) NOT NULL default '',
    `poll_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
    `poll_votecount` mediumint(9) NOT NULL default '0',
    `poll_status` varchar(6) default NULL,
    PRIMARY KEY (`poll_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbPollQuestion` */

    insert into `tbPollQuestion`(`poll_id`,`poll_question`,`poll_timestamp`,`poll_votecount`,`poll_status`) values (3,'Summer will be...','2006-06-18 21:53:47',0,'');

    /*Table structure for table `tbPost` */

    DROP TABLE IF EXISTS `tbPost`;

    CREATE TABLE `tbPost` (
    `post_id` smallint(6) NOT NULL auto_increment,
    `post_card` tinyint(10) NOT NULL default '0',
    `post_stamp` tinyint(10) NOT NULL default '0',
    `post_sname` varchar(100) NOT NULL default '',
    `post_semail` varchar(100) NOT NULL default '',
    `post_rname` varchar(100) NOT NULL default '',
    `post_remail` varchar(100) NOT NULL default '',
    `post_message` text NOT NULL,
    `post_date` datetime NOT NULL default '0000-00-00 00:00:00',
    `post_active` tinyint(10) NOT NULL default '0',
    PRIMARY KEY (`post_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=380 DEFAULT CHARSET=latin1;

    /*Data for the table `tbPost` */

    insert into `tbPost`(`post_id`,`post_card`,`post_stamp`,`post_sname`,`post_semail`,`post_rname`,`post_remail`,`p ost_message`,`post_date`,`post_active`) values (378,0,0,'','','','','','2009-02-16 17:55:51',1),(379,0,0,'','','','','','2009-02-16 17:55:51',1);

    /*Table structure for table `tbSearch` */

    DROP TABLE IF EXISTS `tbSearch`;

    CREATE TABLE `tbSearch` (
    `search_id` smallint(50) NOT NULL auto_increment,
    `search_key` varchar(255) NOT NULL default '',
    `search_date` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY (`search_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=11229 DEFAULT CHARSET=latin1;

    /*Data for the table `tbSearch` */

    insert into `tbSearch`(`search_id`,`search_key`,`search_date`) values (1,'photography','2006-05-21 14:01:40'),(2,'attractions','2006-05-21 14:48:27'),(3,'night clubs','2006-05-21 18:26:19'),(4,'night clubs','2006-05-21 18:26:49');

    /*Table structure for table `tbSection` */

    DROP TABLE IF EXISTS `tbSection`;

    CREATE TABLE `tbSection` (
    `section_id` tinyint(15) unsigned NOT NULL auto_increment,
    `section_name` varchar(20) NOT NULL default '',
    PRIMARY KEY (`section_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 COMMENT='site sections';

    /*Data for the table `tbSection` */

    insert into `tbSection`(`section_id`,`section_name`) values (1,'services'),(2,'accommodation'),(3,'classifieds'),(4,'shopping'),(5,'community'),(6,'leisure');

    /*Table structure for table `tbSubs` */

    DROP TABLE IF EXISTS `tbSubs`;

    CREATE TABLE `tbSubs` (
    `subs_id` smallint(6) NOT NULL auto_increment,
    `subs_first` varchar(100) NOT NULL default '',
    `subs_last` varchar(100) NOT NULL default '',
    `subs_email` varchar(250) NOT NULL default '',
    `subs_type` varchar(10) NOT NULL default '',
    `subs_date` datetime NOT NULL default '0000-00-00 00:00:00',
    `subs_active` tinyint(10) NOT NULL default '1',
    PRIMARY KEY (`subs_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=299 DEFAULT CHARSET=latin1;

    /*Data for the table `tbSubs` */

    insert into `tbSubs`(`subs_id`,`subs_first`,`subs_last`,`subs_email`,`subs_type`,`subs_date`,`subs_active`) values (262,'M','Martinner','beach@yahoo','html','2008-12-18 14:06:24',1);

    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    Last edited by neda; 02-25-2009 at 07:08 PM.

  • #8
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's the Database back up today 25/2/09 after the upgrade (all sensitive data has been taken out, just example data left)

    /*
    SQLyog Community Edition- MySQL GUI v7.11
    MySQL - 5.0.45 : Database - testdb
    *********************************************************************
    */


    /*!40101 SET NAMES utf8 */;

    /*!40101 SET SQL_MODE=''*/;

    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

    CREATE DATABASE /*!32312 IF NOT EXISTS*/`testdb` /*!40100 DEFAULT CHARACTER SET latin1 */;

    USE `testdb`;

    /*Table structure for table `tbAdBanners` */

    DROP TABLE IF EXISTS `tbAdBanners`;

    CREATE TABLE `tbAdBanners` (
    `banner_id` mediumint(9) NOT NULL auto_increment,
    `client_id` mediumint(9) NOT NULL default '0',
    `banner_active` enum('t','f') NOT NULL default 't',
    `banner_image` varchar(255) NOT NULL default '',
    `cache_html` blob NOT NULL,
    `banner_width` smallint(6) NOT NULL default '0',
    `banner_height` smallint(6) NOT NULL default '0',
    `banner_seq` tinyint(4) NOT NULL default '0',
    `banner_url` varchar(255) NOT NULL default '',
    `banner_alt` varchar(255) NOT NULL default '',
    `banner_description` varchar(255) NOT NULL default '',
    PRIMARY KEY (`banner_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdBanners` */

    insert into `tbAdBanners`(`banner_id`,`client_id`,`banner_active`,`banner_image`,`cache_html`,`banner_width`,`ba nner_height`,`banner_seq`,`banner_url`,`banner_alt`,`banner_description`) values (1,1,'t','ad001-01.gif','<a href=\"{urlprefix}ads/adclick.php?bannerid={bannerid}&loc={loc}&dest=http://www.test.co.uk/index.php\" target=\"_blank\"><img src=\"{urlprefix}images/ads/ad001-02.gif\" width=\"468\" height=\"60\" alt=\"Advertise with us\" title=\"(opens in new window)\" border=\"0\"></a>',468,60,0,'http://www.test.co.uk/index.php','Advertise with us','advert');

    /*Table structure for table `tbAdCache` */

    DROP TABLE IF EXISTS `tbAdCache`;

    CREATE TABLE `tbAdCache` (
    `cache_id` varchar(255) NOT NULL default '',
    `cache_content` blob NOT NULL,
    PRIMARY KEY (`cache_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdCache` */

    insert into `tbAdCache`(`cache_id`,`cache_content`) values ('loc=zone:2','a:3:{i:0;i:2;i:1;a:4:{i:0;a:19:{i:0;s:2:\"29\";s:8:\"bannerid\";s:2:\"29\";i:1;s:2:\" 13\";s:8:\"clientid\";s:2:\"13\";i:2;s:13:\"ad018-01.jpg\";i:3;s:32:\"http://www.myspace.com/yovamusic\";s:3:\"url\";s:32:\"http://www.myspace.com/yovamusic\";i:4;s:310:\"<a href=\"{urlprefix}ads/adclick.php?bannerid={bannerid}&loc={loc}&dest=http://www.myspace.com/yovamusic\" target=\"_blank\"><img src=\"{urlprefix}images/ads/ad018-01.jpg\" width=\"468\" height=\"60\" alt=\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\" title=\"(opens in new window)\" border=\"0\"></a>\";s:9:\"htmlcache\";s:310:\"<a href=\"{urlprefix}ads/adclick.php?bannerid={bannerid}&loc={loc}&dest=http://www.myspace.com/yovamusic\" target=\"_blank\"><img src=\"{urlprefix}images/ads/ad018-01.jpg\" width=\"468\" height=\"60\" alt=\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\" title=\"(opens in new window)\" border=\"0\"></a>\";i:5;s:3:\"468\";s:5:\"width\";s:3:\"468\";i:6;s:2:\"60\";s:6:\"height\";s:2:\"60\";i:7;s:1:\"0\ ";s:3:\"seq\";s:1:\"0\";i:8;s:67:\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\";s:3:\"alt\";s:67:\"Jova Radevska-Yova music-debut album, Hourglass Diary available now\";s:10:\"banner_seq\";i:0;}}i:2;s:14:\"12,34,35,42,44\";}');

    /*Table structure for table `tbAdClicks` */

    DROP TABLE IF EXISTS `tbAdClicks`;

    CREATE TABLE `tbAdClicks` (
    `banner_id` mediumint(9) NOT NULL default '0',
    `ad_totalclicks` mediumint(100) default NULL,
    `click_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    KEY `date` (`click_date`),
    KEY `banner_date` (`banner_id`,`click_date`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdClicks` */

    insert into `tbAdClicks`(`banner_id`,`ad_totalclicks`,`click_date`) values (1,2,'2006-07-05 00:00:00'),(2,0,'2006-07-05 00:00:00'),(1,0,'2006-07-06 00:00:00');

    /*Table structure for table `tbAdClients` */

    DROP TABLE IF EXISTS `tbAdClients`;

    CREATE TABLE `tbAdClients` (
    `client_id` mediumint(9) NOT NULL auto_increment,
    `client_name` varchar(255) NOT NULL default '',
    `client_email` varchar(255) NOT NULL default '',
    `client_expire` date default '0000-00-00',
    `client_active` enum('t','f') NOT NULL default 't',
    `client_reportlast` date NOT NULL default '0000-00-00',
    PRIMARY KEY (`client_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdClients` */

    insert into `tbAdClients`(`client_id`,`client_name`,`client_email`,`client_expire`,`client_active`,`client_repor tlast`) values (20,'Retreats','me@retreats.co.uk','2009-04-04','t','2008-07-31'),(22,'Tour DVD','surfer@aol.com','2008-08-27','t','0000-00-00');

    /*Table structure for table `tbAdStats` */

    DROP TABLE IF EXISTS `tbAdStats`;

    CREATE TABLE `tbAdStats` (
    `ad_views` int(11) NOT NULL default '0',
    `ad_clicks` int(11) NOT NULL default '0',
    `ad_day` date NOT NULL default '0000-00-00',
    `ad_hour` tinyint(4) NOT NULL default '0',
    `banner_id` smallint(6) NOT NULL default '0',
    `zone_id` smallint(6) NOT NULL default '0',
    PRIMARY KEY (`ad_day`,`ad_hour`,`banner_id`,`zone_id`),
    KEY `banner_day` (`banner_id`,`ad_day`),
    KEY `zoneid` (`zone_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdStats` */

    insert into `tbAdStats`(`ad_views`,`ad_clicks`,`ad_day`,`ad_hour`,`banner_id`,`zone_id`) values (8,0,'2009-02-24',23,44,15),(1,0,'2009-02-25',9,31,1),(1,0,'2009-02-24',10,27,8);

    /*Table structure for table `tbAdViews` */

    DROP TABLE IF EXISTS `tbAdViews`;

    CREATE TABLE `tbAdViews` (
    `banner_id` mediumint(9) NOT NULL default '0',
    `ad_totalviews` mediumint(100) default NULL,
    `view_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    KEY `date` (`view_date`),
    KEY `banner_date` (`banner_id`,`view_date`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdViews` */

    insert into `tbAdViews`(`banner_id`,`ad_totalviews`,`view_date`) values (1,27,'2006-07-05 00:00:00'),(2,13,'2006-07-05 00:00:00'),(1,39,'2006-07-06 00:00:00');

    /*Table structure for table `tbAdZones` */

    DROP TABLE IF EXISTS `tbAdZones`;

    CREATE TABLE `tbAdZones` (
    `zone_id` mediumint(9) NOT NULL auto_increment,
    `zone_name` varchar(245) NOT NULL default '',
    `zone_banners` varchar(100) default NULL,
    `zone_active` smallint(6) NOT NULL default '0',
    `zone_width` smallint(6) NOT NULL default '0',
    `zone_height` smallint(6) NOT NULL default '0',
    PRIMARY KEY (`zone_id`),
    KEY `zonenameid` (`zone_name`,`zone_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=31 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdZones` */

    insert into `tbAdZones`(`zone_id`,`zone_name`,`zone_banners`,`zone_active`,`zone_width`,`zone_height`) values (1,'hometop','29,31,37,42',1,468,60),(2,'servicestop','29,31,35,42',0,468,60),(3,'leisuretop','15,25 ,35,42,44',0,468,60);

    /*Table structure for table `tbAdmin` */

    DROP TABLE IF EXISTS `tbAdmin`;

    CREATE TABLE `tbAdmin` (
    `admin_id` smallint(10) NOT NULL auto_increment,
    `admin_user` varchar(100) NOT NULL default '',
    `admin_pass` varchar(100) NOT NULL default '',
    `admin_level` tinyint(4) NOT NULL default '0',
    PRIMARY KEY (`admin_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

    /*Data for the table `tbAdmin` */

    insert into `tbAdmin`(`admin_id`,`admin_user`,`admin_pass`,`admin_level`) values (1,'user1','pass1',1),(2,'user2','pass2',1);

    /*Table structure for table `tbCompEntry` */

    DROP TABLE IF EXISTS `tbCompEntry`;

    CREATE TABLE `tbCompEntry` (
    `compentry_id` smallint(6) NOT NULL auto_increment,
    `comp_id` smallint(6) NOT NULL default '0',
    `compentry_answer` varchar(100) NOT NULL default '???',
    `compentry_business` varchar(255) default NULL,
    `compentry_title` varchar(20) NOT NULL default '???',
    `compentry_first` varchar(100) NOT NULL default '???',
    `compentry_last` varchar(100) NOT NULL default '???',
    `compentry_dob` varchar(100) default NULL,
    `compentry_street` varchar(255) NOT NULL default '???',
    `compentry_town` varchar(255) NOT NULL default '???',
    `compentry_pcode` varchar(20) NOT NULL default '???',
    `compentry_phone` varchar(20) NOT NULL default '???',
    `compentry_email` varchar(100) NOT NULL default '???',
    `compentry_info` varchar(20) NOT NULL default 'no',
    `compentry_terms` varchar(20) NOT NULL default 'yes',
    `compentry_date` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY (`compentry_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=1900 DEFAULT CHARSET=latin1;

    /*Data for the table `tbCompEntry` */

    insert into `tbCompEntry`(`compentry_id`,`comp_id`,`compentry_answer`,`compentry_business`,`compentry_title`,`co mpentry_first`,`compentry_last`,`compentry_dob`,`compentry_street`,`compentry_town`,`compentry_pcode `,`compentry_phone`,`compentry_email`,`compentry_info`,`compentry_terms`,`compentry_date`) values (3,1,'newquay','','Mrs','','someone','28/10/1976','Road','','wW343','555555','test@yahoo.co.uk','yes','yes','2006-05-25 15:42:34');

    /*Table structure for table `tbEvent` */

    DROP TABLE IF EXISTS `tbEvent`;

    CREATE TABLE `tbEvent` (
    `event_id` mediumint(9) NOT NULL auto_increment,
    `event_title` varchar(255) NOT NULL default '',
    `event_description` mediumtext,
    `event_startdate` datetime default '0000-00-00 00:00:00',
    `event_enddate` datetime default '0000-00-00 00:00:00',
    `event_starttime` varchar(100) default NULL,
    `event_endtime` varchar(100) default NULL,
    `event_months` varchar(50) default NULL,
    `event_website` varchar(255) default NULL,
    `event_venue` mediumtext,
    `event_phone` varchar(20) default NULL,
    `event_email` varchar(100) default NULL,
    `event_active` tinyint(4) NOT NULL default '0',
    PRIMARY KEY (`event_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=626 DEFAULT CHARSET=latin1;

    /*Data for the table `tbEvent` */

    insert into `tbEvent`(`event_id`,`event_title`,`event_description`,`event_startdate`,`event_enddate`,`event_star ttime`,`event_endtime`,`event_months`,`event_website`,`event_venue`,`event_phone`,`event_email`,`eve nt_active`) values (625,'Wedding Fayre','','2009-02-20 00:00:00','2009-02-21 00:00:00','11am','3pm','2','','','','',1);

    /*Table structure for table `tbLaunch` */

    DROP TABLE IF EXISTS `tbLaunch`;

    CREATE TABLE `tbLaunch` (
    `launch_email` varchar(255) NOT NULL default '',
    `launch_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbLaunch` */

    insert into `tbLaunch`(`launch_email`,`launch_date`) values ('test@yahoo.com','2006-05-01 11:28:19');

    /*Table structure for table `tbListCategory` */

    DROP TABLE IF EXISTS `tbListCategory`;

    CREATE TABLE `tbListCategory` (
    `listcat_id` smallint(150) unsigned NOT NULL auto_increment,
    `section_id` tinyint(10) NOT NULL default '0',
    `listcat_name` varchar(30) NOT NULL default '',
    PRIMARY KEY (`listcat_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=106 DEFAULT CHARSET=latin1;

    /*Data for the table `tbListCategory` */

    insert into `tbListCategory`(`listcat_id`,`section_id`,`listcat_name`) values (1,1,'building'),(2,1,'legal'),(3,5,'education'),(4,6,'pubs & bars');

    /*Table structure for table `tbListSubcategory` */

    DROP TABLE IF EXISTS `tbListSubcategory`;

    CREATE TABLE `tbListSubcategory` (
    `listsubcat_id` mediumint(150) unsigned NOT NULL auto_increment,
    `listcat_id` smallint(10) NOT NULL default '0',
    `listsubcat_name` varchar(30) NOT NULL default '',
    `listcat_name` varchar(255) default NULL,
    `section_name` varchar(255) NOT NULL default '',
    `listsubcat_key` mediumtext,
    PRIMARY KEY (`listsubcat_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=360 DEFAULT CHARSET=latin1 COMMENT='listing subcategories';

    /*Data for the table `tbListSubcategory` */

    insert into `tbListSubcategory`(`listsubcat_id`,`listcat_id`,`listsubcat_name`,`listcat_name`,`section_name`,`li stsubcat_key`) values (1,2,'solictors','legal','services','solicitors, legal aid, lawyer'),(2,1,'builders','building','services','building, build'),(3,1,'plumbers','building','services','plumbing, plumbers, heating engineers, gas installers, gas instalers, gas fitters, gas fiters, heating/plumbing, plumbing/heating');

    /*Table structure for table `tbListings` */

    DROP TABLE IF EXISTS `tbListings`;

    CREATE TABLE `tbListings` (
    `listing_id` smallint(5) unsigned NOT NULL auto_increment,
    `listing_name` varchar(60) NOT NULL default '',
    `listing_street` varchar(50) default NULL,
    `listing_town` varchar(30) default NULL,
    `listing_postcode` varchar(10) default NULL,
    `listing_phone` varchar(15) default NULL,
    `listing_email` varchar(50) default NULL,
    `listing_website` varchar(50) default NULL,
    `listing_cat` tinyint(4) unsigned default NULL,
    `listing_subcat01` smallint(3) unsigned default NULL,
    `listing_subcat02` smallint(3) unsigned default NULL,
    `listing_page` mediumint(5) unsigned default NULL,
    PRIMARY KEY (`listing_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=2292 DEFAULT CHARSET=latin1 COMMENT='site listings';

    /*Data for the table `tbListings` */

    insert into `tbListings`(`listing_id`,`listing_name`,`listing_street`,`listing_town`,`listing_postcode`,`listing _phone`,`listing_email`,`listing_website`,`listing_cat`,`listing_subcat01`,`listing_subcat02`,`listi ng_page`) values (1,'My Business','30Crescent','','','01638 555555',NULL,NULL,10,9,NULL,NULL);

    /*Table structure for table `tbPollAnswer` */

    DROP TABLE IF EXISTS `tbPollAnswer`;

    CREATE TABLE `tbPollAnswer` (
    `poll_id` int(11) NOT NULL default '0',
    `poll_answer` varchar(50) NOT NULL default '',
    `poll_votecount` int(11) NOT NULL default '0',
    `poll_voteid` int(11) NOT NULL default '0',
    `poll_status` varchar(6) default NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbPollAnswer` */

    insert into `tbPollAnswer`(`poll_id`,`poll_answer`,`poll_votecount`,`poll_voteid`,`poll_status`) values (1,'Fistral',4,1,NULL),(1,'Tolcarne',4,2,NULL),(1,'Towan',3,3,NULL),(2,'No',1,3,NULL),(2,'Maybe',2,2 ,NULL),(2,'Yes',2,1,NULL);

    /*Table structure for table `tbPollCheck` */

    DROP TABLE IF EXISTS `tbPollCheck`;

    CREATE TABLE `tbPollCheck` (
    `poll_id` tinyint(5) NOT NULL default '0',
    `poll_voteip` varchar(20) NOT NULL default '',
    `poll_votetime` varchar(14) NOT NULL default '',
    PRIMARY KEY (`poll_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbPollCheck` */

    insert into `tbPollCheck`(`poll_id`,`poll_voteip`,`poll_votetime`) values (0,'81.155.65.15','1235410979');

    /*Table structure for table `tbPollQuestion` */

    DROP TABLE IF EXISTS `tbPollQuestion`;

    CREATE TABLE `tbPollQuestion` (
    `poll_id` int(11) NOT NULL default '0',
    `poll_question` varchar(150) NOT NULL default '',
    `poll_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
    `poll_votecount` mediumint(9) NOT NULL default '0',
    `poll_status` varchar(6) default NULL,
    PRIMARY KEY (`poll_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    /*Data for the table `tbPollQuestion` */

    insert into `tbPollQuestion`(`poll_id`,`poll_question`,`poll_timestamp`,`poll_votecount`,`poll_status`) values (3,'Summer will be...','2006-06-18 21:53:47',0,'');

    /*Table structure for table `tbPost` */

    DROP TABLE IF EXISTS `tbPost`;

    CREATE TABLE `tbPost` (
    `post_id` smallint(6) NOT NULL auto_increment,
    `post_card` tinyint(10) NOT NULL default '0',
    `post_stamp` tinyint(10) NOT NULL default '0',
    `post_sname` varchar(100) NOT NULL default '',
    `post_semail` varchar(100) NOT NULL default '',
    `post_rname` varchar(100) NOT NULL default '',
    `post_remail` varchar(100) NOT NULL default '',
    `post_message` text NOT NULL,
    `post_date` datetime NOT NULL default '0000-00-00 00:00:00',
    `post_active` tinyint(10) NOT NULL default '0',
    PRIMARY KEY (`post_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=380 DEFAULT CHARSET=latin1;

    /*Data for the table `tbPost` */

    insert into `tbPost`(`post_id`,`post_card`,`post_stamp`,`post_sname`,`post_semail`,`post_rname`,`post_remail`,`p ost_message`,`post_date`,`post_active`) values (378,0,0,'','','','','','2009-02-16 17:55:51',1),(379,0,0,'','','','','','2009-02-16 17:55:51',1);

    /*Table structure for table `tbSearch` */

    DROP TABLE IF EXISTS `tbSearch`;

    CREATE TABLE `tbSearch` (
    `search_id` smallint(50) NOT NULL auto_increment,
    `search_key` varchar(255) NOT NULL default '',
    `search_date` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY (`search_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=11231 DEFAULT CHARSET=latin1;

    /*Data for the table `tbSearch` */

    insert into `tbSearch`(`search_id`,`search_key`,`search_date`) values (1,'photography','2006-05-21 14:01:40'),(2,'attractions','2006-05-21 14:48:27'),(3,'night clubs','2006-05-21 18:26:19'),(4,'night clubs','2006-05-21 18:26:49');

    /*Table structure for table `tbSection` */

    DROP TABLE IF EXISTS `tbSection`;

    CREATE TABLE `tbSection` (
    `section_id` tinyint(15) unsigned NOT NULL auto_increment,
    `section_name` varchar(20) NOT NULL default '',
    PRIMARY KEY (`section_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 COMMENT='site sections';

    /*Data for the table `tbSection` */

    insert into `tbSection`(`section_id`,`section_name`) values (1,'services'),(2,'accommodation'),(3,'classifieds'),(4,'shopping'),(5,'community'),(6,'leisure');

    /*Table structure for table `tbSubs` */

    DROP TABLE IF EXISTS `tbSubs`;

    CREATE TABLE `tbSubs` (
    `subs_id` smallint(6) NOT NULL auto_increment,
    `subs_first` varchar(100) NOT NULL default '',
    `subs_last` varchar(100) NOT NULL default '',
    `subs_email` varchar(250) NOT NULL default '',
    `subs_type` varchar(10) NOT NULL default '',
    `subs_date` datetime NOT NULL default '0000-00-00 00:00:00',
    `subs_active` tinyint(10) NOT NULL default '1',
    PRIMARY KEY (`subs_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=300 DEFAULT CHARSET=latin1;

    /*Data for the table `tbSubs` */

    insert into `tbSubs`(`subs_id`,`subs_first`,`subs_last`,`subs_email`,`subs_type`,`subs_date`,`subs_active`) values (299,'AUR','','Dan1@yandex','text','2009-02-25 05:19:12',1);

    /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

  • #9
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,108
    Thanks
    2
    Thanked 326 Times in 318 Posts
    I compared the information you posted using - http://winmerge.org/ and the table definitions are the same.

    The original error message contained data in a format that is not expected for a date or a datatime field - '2009-02-25-11-31-1'

    I suspect that your code is now inserting data that is not correct and results in duplicate values. It would be helpful if you could identify and post the code for the file where the error is occurring.

    Was the php version or php,ini configuration changed at the same time? The symptom is indicative of a register_globals problem where your code was dependent on register_globals to populate some variable and it is no longer being set, so some part of the data is now missing, resulting in duplicate values.

    P.S. If your host cannot tell you what STRICT SQL mode was set to before and what it is set to now, it might be time to look for a different host. On every upgrade, a good host should know and be able to publish exactly what differences there will be and what configuration changes there will be.
    Last edited by CFMaBiSmAd; 02-26-2009 at 11:04 AM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #10
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,108
    Thanks
    2
    Thanked 326 Times in 318 Posts
    Rather than PM'ing me directly, you will get a lot more help in the open forum if you do this -
    It would be helpful if you could identify and post the code for the file where the error is occurring.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #11
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    of course, thanks for your help so far...

  • #12
    New Coder
    Join Date
    Feb 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by CFMaBiSmAd View Post
    I compared the information you posted using - http://winmerge.org/ and the table definitions are the same.

    The original error message contained data in a format that is not expected for a date or a datatime field - '2009-02-25-11-31-1'

    I suspect that your code is now inserting data that is not correct and results in duplicate values. It would be helpful if you could identify and post the code for the file where the error is occurring.

    Was the php version or php,ini configuration changed at the same time? The symptom is indicative of a register_globals problem where your code was dependent on register_globals to populate some variable and it is no longer being set, so some part of the data is now missing, resulting in duplicate values.

    P.S. If your host cannot tell you what STRICT SQL mode was set to before and what it is set to now, it might be time to look for a different host. On every upgrade, a good host should know and be able to publish exactly what differences there will be and what configuration changes there will be.
    Would the following code in my database.php file have anything to do with it?
    //change a date from MySQL format to UK format(dd/mm/yy)
    function DB_mysql2date($date){
    $temp = explode("-",$date);
    $temp2 = explode(" ",$temp[2]);
    $date = mktime(0,0,0,$temp[1],$temp2[0],$temp[0]);
    return $date;
    }//END FUNCTION


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •