| 1 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 | <!DOCTYPE html> <html>
 <head>
 <title>Netshahr.com PHP Course</title>
 </head>
 <body>
 <?php
 
 $server_name = "localhost";
 $username = "root";
 $password = "";
 $my_connection = @mysql_connect($server_name, $username, $password);
 $query = mysql_select_db("new_db", $my_connection);
 if ($query) {
 $sql = "CREATE TABLE `new_table` (`id` INT AUTO_INCREMENT PRIMARY KEY, `username` VARCHAR(255), `password` VARCHAR(255))";
 $create_db = mysql_query($sql, $my_connection);
 if ($create_db) {
 echo "Table Created!";
 } else {
 echo "Failed to create the table.";
 }
 }
 
 ?>
 </body>
 </html>
 
 |