Advertisement
Zeinab_Hamdy

task

Aug 4th, 2023
1,007
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.89 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. // // connect
  5. //  $connect = mysqli_connect('localhost' , 'root' , '' , 'task');
  6. // if($connect)
  7. //     echo " connected <br>";
  8. // else
  9. //     echo " not connectec <br>" ;
  10.  
  11.  
  12. // // //  create table
  13. // $create = "create table students (id  int primary key auto_increment
  14. // , name varchar(20) , password varchar(20) , age varchar(20) )";
  15. // $create_table = mysqli_query($connect ,$create);
  16. // if($create_table)
  17. //     echo "table created successfully <br>";
  18. // else
  19. //    echo "table not created <br>";
  20.  
  21.  
  22. // // // id , name , pssword , age
  23. // $insert = "insert into students values('' , 'Zainab' , '1234' , '20')";
  24. // $insert1 = mysqli_query($connect , $insert);
  25. // if($insert1)    
  26. //     echo "row 1 inserted<br>";
  27. // else
  28. //     echo "row 1 not inserted<br>";
  29.  
  30.  
  31.  
  32. // $insert = "insert into students values('' , 'Ahmed' , '1993' , '10')";
  33. // $insert1 = mysqli_query($connect , $insert);
  34. // if($insert1)    
  35. //     echo "row 2 inserted<br>";
  36. // else
  37. //     echo "row 2 not inserted<br>";
  38.  
  39.  
  40.  
  41. // $insert = "insert into students values('' , 'Omar' , '3992' , '40')";
  42. // $insert1 = mysqli_query($connect , $insert);
  43. // if($insert1)    
  44. //     echo "row 3 inserted<br>";
  45. // else
  46. //     echo "row 3 not inserted<br>";
  47.  
  48.  
  49. // $insert = "insert into students values('' , 'Mariam' , '3012' , '21')";
  50. // $insert1 = mysqli_query($connect , $insert);
  51. // if($insert1)    
  52. //     echo "row 4 inserted<br>";
  53. // else
  54. //     echo "row 4 not inserted<br>";
  55.  
  56.  
  57.  
  58. // $select = "select * from students";
  59. // $output =mysqli_query($connect , $select);
  60.  
  61. // echo "<br><br><br>";
  62. // echo "row in the table students : <br><br> ";
  63. // while($out = mysqli_fetch_assoc($output)){
  64. //     echo $out['id']  , "                        " , $out['name'], "                        " , $out['password'], "                        " , $out['age'] , "<br>";
  65. //     echo "==============<br>";
  66. // }
  67.  
  68. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement