PHP MySQL Query "Create Table" - Newbies Need Help

I am trying to create a simple database table using the PHP MySQL "Create Table" query, but it doesn't work.

What's wrong with the code below?

 // Make a MySQL Connection
mysql_connect("localhost","the_database_name","the_database_password") or die(mysql_error());
mysql_select_db("the_database_name") or die(mysql_error());

// Create a MySQL table in the selected database
mysql_query("CREATE TABLE downloads_list(
download_id INT(7) UNSIGNED NOT NULL AUTO_INCREMENT,
download_date TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
visitor_first_name VARCHAR(20) NOT NULL,
visitor_last_name VARCHAR(20) NOT NULL,
visitor_email VARCHAR(50) NOT NULL,
visitor_phone VARCHAR(30) NOT NULL,
store_name VARCHAR(20) NOT NULL,
document_name VARCHAR(200) NOT NULL,
PRIMARY KEY (download_id)")
 or die(mysql_error());  

echo "Table Created!";

      

0


a source to share


1 answer


It looks like you are not covering the wig that you opened immediately after download_list

.



+3


a source







All Articles