<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Create Table of Users</title>
</head>

<body><?php

	$link = mysql_connect("localhost", "hmhcs_atmusers", "umopapisdn") or die('Could not connect: ' . mysql_error());
	mysql_select_db("hmhcs_atmusers", $link) or die('Could not select database');
	
	//$query = "SELECT items.itemnum AS number, items.model, items.brand, items.price AS givingprice, items.ourprice, options.* FROM `items` LEFT JOIN `options` ON items.itemnum = options.itemnum WHERE items.stock > '0' ORDER BY `brand`, items.model, options.price";
	
	
	  // If we couldn't, then it either doesn't exist, or we can't see it.
	  $sql = 'CREATE TABLE IF NOT EXISTS `users` (
				`index` int(11) NOT NULL AUTO_INCREMENT,
				`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
				`efx` int(11) NOT NULL,
				`datastream` int(11) NOT NULL,
				`enabled` int(11) NOT NULL,
				`expires` date NOT NULL,
				PRIMARY KEY (`index`),
				UNIQUE KEY `username` (`username`)
				)';
	
	  if (mysql_query($sql, $link)) {
		  echo "Table `users` created successfully\n";
	  } else {
		  echo 'Error creating database: ' . mysql_error() . "\n";
	  }

	
	mysql_close($link);
	//while($row = mysql_fetch_assoc($result))


 ?>
</body>
</html>
