Home » Php » php – I cannot get MySQL CREATE TABLE to execute

php – I cannot get MySQL CREATE TABLE to execute

Posted by: admin February 25, 2020 Leave a comment

Questions:

I cannot get that generate table query to execute. The mysqli error function displays an error in syntax, but I couldn’t fix it.

<?php

$CS_server = "localhost";
$CS_username = "root";
$CS_password = "";
$CS_database = "CS";

$CS_conn = new mysqli($CS_server, $CS_username, $CS_password, $CS_database);

$random_id = rand(0,5);

$generate_table = mysqli_query($CS_conn,"CREATE TABLE `" .$random_id."` (coin_balance UNSIGNED) ");
How to&Answers: