Guest User

Untitled

a guest
Dec 11th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. <title>title</title>
  5. </head>
  6.  
  7. <body>
  8.  
  9. <?php
  10. $con = mysql_connect("localhost","root","");
  11. if(!$con){
  12. die('could not connect:' . mysql_error());
  13. }
  14.  
  15. if(mysql_query("CREATE DATABASE students", $con)){
  16. echo "database created";
  17. }
  18. else{
  19. echo "error creating database : " . mysql_error();
  20. }
  21.  
  22. mysql_select_db("students", $con);
  23. $sql = "create table information (FirstName varchar(15), LastName varchar(15), Age int)";
  24. //execute
  25. mysql_query($sql,$con);
  26.  
  27. mysql_close($con);
  28.  
  29.  
  30. ?>
  31.  
  32.  
  33.  
  34.  
  35. </body>
  36.  
  37. </html>
Add Comment
Please, Sign In to add comment