zoukankan      html  css  js  c++  java
  • php入门指南

     测试代码:

    <html>
    <head>
        <title>通过PHP连接MySQL服务器</title>
    </head>
    <body>
    <?php
    $link = mysqli_connect("127.0.0.1", "root", "123456", "bishe");
    
    if (!$link) {
        echo "Error: Unable to connect to MySQL." . PHP_EOL;
        echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
        echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
        exit;
    }
    $sql = "SELECT * FROM choice_error";
    $result = $link->query($sql);
    if ($result->num_rows > 0) {
        // 输出数据
        while($row = $result->fetch_assoc()) {
            echo "id: " . $row["question_id"]. " - Name: " . $row["question_name"]. " " . $row["question_type"]. ""
    "";
        }
    } else {
        echo "0 结果";
    }
    echo "Success: A proper connection to MySQL was made! The my_db database is great." . PHP_EOL;
    echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;
    mysqli_close($link);
    
    ?>
    </body>
    </html>
    

      

    Unkonw Unkonw(你不知道一样东西,你也会不知道自己不知道这样东西)
  • 相关阅读:
    c++ stl常用
    c++流操作
    操作符重载operator
    函数指针和指针函数
    指针c艹
    Oracle 账户锁定问题解决办法
    java回收算法
    JDK与JRE的区别
    关于getClass().getClassLoader()
    After reading a picture than out a picture
  • 原文地址:https://www.cnblogs.com/2014-1130/p/13536704.html
Copyright © 2011-2022 走看看