Skip to content

Instantly share code, notes, and snippets.

@Levik
Created March 6, 2012 09:59
Show Gist options
  • Select an option

  • Save Levik/1985421 to your computer and use it in GitHub Desktop.

Select an option

Save Levik/1985421 to your computer and use it in GitHub Desktop.
<?php
require_once 'login.php';
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if (!$db_server) die ("Error: connect ". mysql_error());
mysql_select_db($db_database)
or die("Error: database". mysql_error());
$query= "CREATE TABLE cats(
id SMALLINT NOT NULL AUTO_INCREMENT,
family VARCHAR (32) NOT NULL,
name VARCHAR (32) NOT NULL,
age TINYINT NOT NULL,
PRIMARY KEY (id)
)";
$result = mysql_query($query);
if (!$result) die ("Error: access". mysql_error());
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment