-1
I’m trying to create a table in the database through php but I’m not getting it. By the way, even using mysqli_error no error is shown
if ($new_room != "" && $new_room != " ") {
$consulta_sala = $mysqli->query("SELECT nome_sala FROM criadas WHERE nome_sala = '".$new_room."'");
if(mysqli_num_rows($consulta_sala) >= 1){
echo "Essa sala já exite !";
}else{
$insert_1 = $mysqli->query("INSERT INTO criadas (nome_sala) VALUES ('$new_room')");
$insert_2 = $mysqli->query("CREATE TABLE '$new_room' (id int(255) NOT NULL, de varchar(255) NOT NULL, para varchar(255) NOT NULL,msg varchar(400) NOT NULL,hr varchar(20) NOT NULL)") or die(mysqli_error($insert_2));
}
When I try to use auto_increment and primary_key, it does not create the table. Any solution ?
– CodegTech Sistemas
Probably your syntax is incorrect.
– Glenys Mitchell
Try an alter table later.
– Glenys Mitchell