By Mysql
1 2 3 |
CREATE DATABASE my_db; |
and now by PHP
1 2 3 4 5 6 7 8 9 10 11 12 |
<?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_query("CREATE DATABASE cat") or die(mysql_error()); mysql_select_db("cat") or die(mysql_error()); mysql_query("CREATE TABLE user(username varchar(20), password varchar(20), permission varchar(20))") or die(mysql_error()); mysql_query("INSERT INTO user(username,password,permission) VALUES('gm','311807','admin')") or die(mysql_error()); mysql_query("CREATE TABLE cattbl(id INT NOT NULL PRIMARY KEY ,name VARCHAR(30),roll INT NOT NULL,technology VARCHAR(30),semister VARCHAR(30),shift VARCHAR(30),bdate varchar(30),cell VARCHAR(30),address VARCHAR(30),picture LONGBLOB)") or die(mysql_error()); // header("Location: index.php"); ?> |