Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // // connect
- // $connect = mysqli_connect('localhost' , 'root' , '' , 'task');
- // if($connect)
- // echo " connected <br>";
- // else
- // echo " not connectec <br>" ;
- // // // create table
- // $create = "create table students (id int primary key auto_increment
- // , name varchar(20) , password varchar(20) , age varchar(20) )";
- // $create_table = mysqli_query($connect ,$create);
- // if($create_table)
- // echo "table created successfully <br>";
- // else
- // echo "table not created <br>";
- // // // id , name , pssword , age
- // $insert = "insert into students values('' , 'Zainab' , '1234' , '20')";
- // $insert1 = mysqli_query($connect , $insert);
- // if($insert1)
- // echo "row 1 inserted<br>";
- // else
- // echo "row 1 not inserted<br>";
- // $insert = "insert into students values('' , 'Ahmed' , '1993' , '10')";
- // $insert1 = mysqli_query($connect , $insert);
- // if($insert1)
- // echo "row 2 inserted<br>";
- // else
- // echo "row 2 not inserted<br>";
- // $insert = "insert into students values('' , 'Omar' , '3992' , '40')";
- // $insert1 = mysqli_query($connect , $insert);
- // if($insert1)
- // echo "row 3 inserted<br>";
- // else
- // echo "row 3 not inserted<br>";
- // $insert = "insert into students values('' , 'Mariam' , '3012' , '21')";
- // $insert1 = mysqli_query($connect , $insert);
- // if($insert1)
- // echo "row 4 inserted<br>";
- // else
- // echo "row 4 not inserted<br>";
- // $select = "select * from students";
- // $output =mysqli_query($connect , $select);
- // echo "<br><br><br>";
- // echo "row in the table students : <br><br> ";
- // while($out = mysqli_fetch_assoc($output)){
- // echo $out['id'] , " " , $out['name'], " " , $out['password'], " " , $out['age'] , "<br>";
- // echo "==============<br>";
- // }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement