I'm trying to create a SQL table in PHP using the following code:
$sql = "CREATE TABLE `$DBName`.`$login`_clients (
ClientID int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`ClientID`),
AgentClients varchar(15),
ClientTotal int
)";
The botton script runs fine and saves the database as my $login
query. I wanted to save the table as $login_clients
however. Ex. $login="Fred"
, then the table would be named Fred_clients. I have tried a few different methods of combining variables with text but can't get the format down. Any suggestions?
$sql = "CREATE TABLE `$DBName`.`$login`_clients (
ClientID int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`ClientID`),
AgentClients varchar(15),
ClientTotal int
)";