search

Home  >  Q&A  >  body text

Five words: fierce new ah ah ah

If the table has been created in the database, there is no need for the first step. Then how to link this table?

2757 days ago1130

reply all(1)I'll reply

  • 代言

    代言2017-06-27 17:26:59

    <?php
    // 创建连接
    $conn = new mysqli("localhost", "uesename", "password");
    // 检测连接
    if ($conn->connect_error) 
    {    
        die("连接失败: " . $conn->connect_error);} 
        // 创建数据库
        $sql = "CREATE DATABASE test";
            if ($conn->query($sql) === TRUE) 
            {    
            echo "数据库创建成功";
            } else {    
            echo "Error creating database:" . $conn->error;
            }
        $conn->close();
    ?>


    reply
    0
  • Cancelreply