Create mysql table with php variable not working

后端 未结 4 1010
生来不讨喜
生来不讨喜 2020-12-07 06:28

I\'m pretty new to php.. and this is probably a stupid mistake... but I have no idea what is going on. I\'m trying to create a table in my database using php. I want to name

4条回答
  •  春和景丽
    2020-12-07 07:00

    // Create MySql table with variable

    $tableName = "tb-"."$userEmail";
    $tName="Beta";  
    $createTable = "CREATE TABLE ".$tName." ( UserName varchar(30), UserPassword varchar(30) )" ;
    

    This above syntax works. Apply this example to your code. Please review some error in your concatenation

提交回复
热议问题