The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: tony | June 29, 2009 @ 9:07am
PHP Code
[
Download
]
<?php $user="root"; $password="panda"; $db="cms"; mysql_connect(localhost, $user, $password); @mysql_select_db($db) or die (mysql_error()); $sql="CREATE TABLE IF NOT EXISTS cms_access_levels ( access_level tinyint (4) NOT NULL auto_increment, access_name varchar (50) NOT NULL default '', PRIMARY KEY (access_level) )"; $result=mysql_query($sql) or die (mysql_error()); mysql_query ("INSERT INTO cms_access_levels (access_level, access_name) VALUES ('1', 'user', '2', 'moderator', '3', 'adminstrator')") or die (mysql_error()); $sql2= "CREATE TABLE IF NOT EXISTS cms_articles ( article_id int (11) NOT NULL auto_increment, author_id int (11) NOT NULL default '0', is_published tinyint(1) NOT NULL default '0', date_submitted datetime NOT NULL default '0000-00-00 00:00:00', date_published datetime NOT NULL default '0000-00-00 00:00:00', title varchar (255) NOT NULL default '', body mediumtext NOT NULL, primary key (article_id), )"; $result=mysql_query($sql2) or die (mysql_error()); $sql3="CREATE TABLE IF NOT EXISTS cms_comments ( comments_id int (11) NOT NULL auto_increment, article_id int (11) NOT NULL default '0', comment_date datetime NOT NULL default '0000-00-00 00:00:00', comment_user int (11) NOT NULL default '0', comment text NOT NULL, PRIMARY KEY (comment_id), )"; $sql4= "CREATE TABLE IF NOT EXISTS cms_users ( user_id int (11) NOT NULL auto_increment, email varchar (255) NOT NULL default '', password varchar (30) NOT NULL default '', name varchar (50) NOT NULL default '', access_level tinyint (4) NOT NULL default '1', PRIMARY KEY (user_id), )"; $result=mysql_query ($sql) or die (mysql_error()); $adminemail="yakzuaman@hotmail.co.uk"; $adminpass="panda2"; $adminname="tony"; mysql_query ("INSERT IGNORE INTO cms_users VALUES (NULL, '$adminemail', '$adminpass', '$adminname', '3',)") or die (mysql_error()); ?>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.57 / 8
133 Votes
http://codebin.yi.org/318
page generated in 0.00 seconds