Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'condb.php';
- $sql="CREATE TABLE students
- (
- id INT AUTO_INCREMENT PRIMARY KEY,
- student_name VARCHAR(100) NOT NULL,
- student_class INT(10) NOT NULL,
- student_roll INT(10) NOT NULL,
- student_section INT(15) NOT NULL
- )";
- $sql1="CREATE TABLE class(
- id INT AUTO_INCREMENT PRIMARY KEY,
- class_name VARCHAR(100) NOT NULL,
- class_numeric_value int(10) NOT NULL
- )";
- $sql2="CREATE TABLE section(
- id INT AUTO_INCREMENT PRIMARY KEY,
- class_id INT(10) NOT NULL,
- section_name VARCHAR(100) NOT NULL
- )";
- $sql3="CREATE TABLE parents(
- id INT AUTO_INCREMENT PRIMARY KEY,
- student_id INT(10) NOT NULL,
- parent_name VARCHAR(100) NOT NULL,
- parent_phone_number INT(10) NOT NULL
- )";
- $conn->query($sql);
- $conn->query($sql1);
- $conn->query($sql2);
- $conn->query($sql3);
- ?>
- database cannect:
- <?php
- $host="localhost";
- $user="root";
- $pass="";
- $db="school";
- $conn=new mysqli($host,$user,$pass,$db);
- if($conn->connect_error)
- {
- die("Error : ".$conn->connect_error);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement