Menu
I want to know how to create multiple tables using a for loop in php code on a local sql db
i tried using this kind of code which is not working
for($i=0;$i=5;$i++)
{
$sql=”CREATE TABLE Hi_$i” (FirstName CHAR(30),LastName CHAR(30),Age INT)”;
// Execute query
if (mysqli_query($con,$sql))
{
echo “Table persons created successfully”;
}
else
{
echo “Error creating table: ” . mysqli_error($con);
}
any help
Thanks in advance