本文实例讲述了基于CakePHP实现的简单博客系统。分享给大家供大家参考。具体实现方法如下:
--
-- Table structure for table posts
DROP TABLE IF EXISTS posts
;
/!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE posts
(
id
int(10) unsigned NOT NULL AUTO_INCREMENT,title
varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,body
text COLLATE utf8_unicode_ci,created
datetime DEFAULT NULL,modified
datetime DEFAULT NULL,PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/!40101 SET character_set_client = @saved_cs_client /;
-- Dumping data for table posts
LOCK TABLES posts
WRITE;
/!40000 ALTER TABLE posts
DISABLE KEYS /;
INSERT INTO posts
VALUES (1,'The title','This is the post body.','2012-11-01 15:43:41',NULL),(2,'A title once again','And the post body follows.',(3,'Title strikes back','This is really exciting! Not.',(4,'ggjjkhkhhk','7777777777777777777777777\r\n777777777777777777777777','2012-11-01 20:16:28','2012-11-01 20:16:28');
/!40000 ALTER TABLE posts
ENABLE KEYS /;
UNLOCK TABLES;
-- Table structure for table schema_migrations
DROP TABLE IF EXISTS schema_migrations
;
/!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE schema_migrations
(
version
varchar(255) COLLATE utf8_unicode_ci NOT NULL,UNIQUE KEY unique_schema_migrations
(version
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/!40101 SET character_set_client = @saved_cs_client /;
-- Dumping data for table schema_migrations
LOCK TABLES schema_migrations
WRITE;
/!40000 ALTER TABLE schema_migrations
DISABLE KEYS /;
INSERT INTO schema_migrations
VALUES ('20121013024711'),('20121013030850');
/!40000 ALTER TABLE schema_migrations
ENABLE KEYS /;
UNLOCK TABLES;
/!40103 SET TIME_ZONE=@OLD_TIME_ZONE /;
/!40101 SET sqlMODE=@OLDsql_MODE /;
/!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS /;
/!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS /;
/!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /;
/!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /;
/!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION /;
/!40111 SET sqlNOTES=@OLDsql_NOTES /;
-- Dump completed on 2012-11-01 16:41:46
希望本文所述对大家的PHP程序设计有所帮助。