Create table (php)

How do I create a table? I’ve uploaded this code on my file manager, and then I’ve visited my website. I went to phpyAdmin but it doesn’t created a table.

My code:

<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <?php
        $server = "sql204.epizy.com";
        $user = "epiz_26098080";
        $password = "HIDDEN BY MOD";
        $db = "epiz_26098080_test"/

        $connect = mysqli_connect($server, $user, $password, $db);

        mysqli_query($connect, "
            CREATE TABLE um (
                id int AUTO_INCREMENT,
                nome varchar(16),
                PRIMARY KEY (id)
            );
        ");
    ?>
</body>
</html>

No, you can’t actually make an php table or database table here in free hosting using php.

You should create a table from Phpmyadmin section at cpanel. It’s quite easy.

Check this last line.
It should be:

$db = "epiz_26098080_test";

5 Likes

Oh. oh. ooooooooooooohhhhhhhhhhh nnnnoooooooooooooooooooooooooooooo. You’re right, that have never happened to me. I’m so angry and confused…

I’ve wasted so many time on it…

Bu now I can create tables with php code! Thank you!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.