I'm wanting to create an sql table, when a user registers at my site. This table will eventually be used to log messages. The code follows:
<?php require('../connect/kidsblogsconnect.php'); $name=trim(mysql_real_escape_string($_POST['name'])); mysql_query("CREATE TABLE '$name'('sender' VARCHAR(30), 'message' VARCHAR(300), 'dateposted' DATE)") or DIE(mysql_error()); ?>
When I run it, I get:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test'('sender' VARCHAR(30), 'message' VARCHAR(300), 'dateposted' DATE)' at line 1
I tried everything I know (which isn't much) but can't figure out why it isn't working. Any help is appreciated. If I need to post the whole code I can but thought it was overkill.