Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?php
  2. //||||||||||||||||||||||||||||||||||||||||||||||\\
  3. //|| Database Configuration V0.1 ALPHA ||\\
  4. //|| By Nathan Heinrich ||\\
  5. //||||||||||||||||||||||||||||||||||||||||||||||\\
  6. $dbhost ="localhost"; //database IP Adress
  7. $dbname = "schools1"; //Database Name
  8. $dbusername = "root"; //Database username
  9. $dbpass = ""; //database password
  10.  
  11.  
  12. /*||||||||||||||||||||||||||||||||||||||||||||||||*\
  13. //########## DO NOT EDIT FROM HERE ON!############\\
  14. \*||||||||||||||||||||||||||||||||||||||||||||||||*/
  15. $con = mysql_connect ("localhost","root","")
  16. or die
  17. ("could not connect: ".mysql_error());
  18. mysql_select_db($dbname, $con);
  19.  
  20. // Create database
  21. if (mysql_query("CREATE DATABASE $dbname",$con))
  22. {
  23. echo "Database created";
  24. }
  25. else
  26. {
  27. echo "Error creating database: " . mysql_error();
  28. }
  29. // Create table
  30. mysql_select_db($dbname, $con);
  31. $user = "CREATE TABLE user
  32. (
  33. userid int(11) NOT NULL auto_increment,
  34. username varchar(32) NOT NULL,
  35. password varchar(255) NOT NULL,
  36. lastlog date NOT NULL,
  37. posts int(5) NOT NULL,
  38. accessid int(2) NOT NULL,
  39. email varchar(255) NOT NULL,
  40. PRIMARY KEY (userid)
  41. )";
  42. /*
  43. $news = "CREATE TABLE news
  44. (
  45. id int(5) NOT NULL auto_increment,
  46. article text(0) NOT NULL,
  47. userid int(11) NOT NULL,
  48. date date(0) NOT NULL,
  49. PRIMARY KEY (id)
  50. )";
  51.  
  52. // Execute query
  53. mysql_query($user,$con);
  54. mysql_query($news,$con);
  55. */
  56.  
  57. mysql_close($con);
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement