duan198811 2015-09-11 17:20
浏览 20

mysqli_query插入localhost,表不更新

I am trying to insert user details into a table i have created using phpmyadmin on a local host server.

the connections are fine and the first user gets inserted into the table no problem.

when I attempt to add another user it does not show in the table in phpmyadmin nor do i get any kind of error.

I have a feeling its something to do with the table configuration but i cannot find any info on this, can something please help.

The Insert code

$result = db_query("INSERT INTO registration_list (first_name, last_name, student_number, email, activation_code, status, time_created, time_updated)
    VALUES (
            '$fname',
            '$sname',
            '$studentNo',
            '$email',
            '$code',
            'awaiting approval',
            now(),
            now()
        )");

The connection

function db_connect(){

static $connection;

if(!isset($connection)) {
    $connection = connectLocalHost($connection);
}
if($connection === false) {
    return db_error();
}
return $connection;
}

function db_query($query) {
// Connect to the database
$connection = db_connect();
// Query the database
$result = mysqli_query($connection,$query);
return $result;
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序
    • ¥15 多址通信方式的抗噪声性能和系统容量对比
    • ¥15 winform的chart曲线生成时有凸起
    • ¥15 msix packaging tool打包问题