Jump to content

Creating a table in php problem...


Jacbey

Recommended Posts

Hi guys, i cannot figure out what is wrong with this and I hope you could help figure it out?

 

This is the code I am using -

 

$create_cart_table = "CREATE TABLE `". $string ."` (cart_id int NOT NULL AUTO_INCREMENT, PRIMARY KEY(cart_id), item_name VARCHAR(1000) NOT NULL, item_id VARCHAR(30) NOT NULL, price VARCHAR(30) NOT NULL, date_time TIMESTAMP(100) NOT NULL CURRENT_TIMESTAMP, quantity VARCHAR(100) NOT NULL)";
$set_cart_table = mysql_query($create_cart_table);

 

$string is defined above and there are no database connection warnings etc coming up and I am lost as to how the heck this isn't working? It was working for about an hour when I first made the script but now it is not. Please help?

Link to comment
https://forums.phpfreaks.com/topic/252899-creating-a-table-in-php-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.