Advertisement
Guest User

createtable.php

a guest
May 31st, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. require_once "config.php";
  2.  
  3. $con=mysqli_connect($db_hostname, $db_username, $db_password);
  4.    if (mysqli_connect_errno())
  5.       {
  6.       echo "Failed to connect to MySQL: ".mysqli_connect_error();
  7.       }
  8.        
  9.    $sql="CREATE TABLE quoter (
  10.         id int NOT NULL AUTO_INCREMENT,
  11.         quote text NOT NULL,
  12.         quoteby CHAR(50) NOT NULL,
  13.         PIMARY KEY (id)
  14.         )";
  15.          
  16.    if (mysqli_query($con,$sql))
  17.       {
  18.       echo "Table 'quoter' was created sucessfully";
  19.       }
  20.    else
  21.       {
  22.       echo "Error creating table 'quoter': ".mysqli_error($con);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement