home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 September / INTERNET107.ISO / pc / projects / createdatabase.txt next >
Encoding:
Text File  |  2003-06-15  |  418 b   |  26 lines

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Creating a database</TITLE>
  4. </HEAD>
  5. <BODY>
  6.  
  7. <?php
  8.  
  9. $DBName="chooseanamedb";
  10.  
  11. $mysql_link=mysql_connect("localhost","username","password");
  12.  
  13. if (mysql_create_db ($DBName, $mysql_link)) {
  14.     print ("The database was successfully created!<BR>\n");
  15. } else {
  16.     print ("Sorry but the database could not be created<BR>\n");
  17. }
  18.  
  19. mysql_close ($mysql_link);
  20.  
  21. ?>
  22.  
  23. </BODY>
  24. </HTML>
  25.  
  26.