第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

MySQL INSERT INTO 語(yǔ)句中的語(yǔ)法錯(cuò)誤

MySQL INSERT INTO 語(yǔ)句中的語(yǔ)法錯(cuò)誤

PHP
富國(guó)滬深 2021-06-29 13:57:08
我的代碼有問(wèn)題。每次嘗試向數(shù)據(jù)庫(kù)中插入內(nèi)容時(shí),都會(huì)出現(xiàn)語(yǔ)法錯(cuò)誤。這是我的數(shù)據(jù)庫(kù)結(jié)構(gòu):CREATE TABLE `notes` (  `id` int(12) NOT NULL,  `type` varchar(15) NOT NULL,  `title` varchar(43) NOT NULL,  `text` varchar(43) NOT NULL,  `group` varchar(32) NOT NULL,  `uid` int(64) NOT NULL,  `creator` int(64) NOT NULL,  `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;ALTER TABLE `notes`  ADD PRIMARY KEY (`id`);ALTER TABLE `notes`  MODIFY `id` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=79;這就是我的代碼<?php    session_start();    require '../config.php';    $notetype    = $_POST['type'];    $notetitle   = $_POST['title'];    $notetext    = $_POST['text'];    $notegroup   = $_POST['group'];    $noteuid     = $_POST['uid'];    $notecreator = $_POST['creator'];    $notetbname  = $note['tbname'];    $conn = new mysqli($databaseconfig['ip'], $databaseconfig['user'], $databaseconfig['pass'], $databaseconfig['dbname']);    if ($conn->connect_error) {        die("Connection failed: " . $conn->connect_error);    }    $sql = "INSERT INTO $notetbname (type, title, text, group, uid, creator)    VALUES ('$notetype', '$notetitle', '$notetext', '$notegroup', $noteuid, $notecreator);";    if ($conn->query($sql) === TRUE) {        echo "New record created successfully";    } else {        echo "Error: " . $sql . "<br>" . $conn->error;    }    $conn->close();?>這是我收到的錯(cuò)誤消息:Error: INSERT INTO notes (type, title, text, group, uid, creator) VALUES ('player', 'Hello there', 'Good morning everybody', 'Cop', 3325, 103);You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'group, uid, creator) VALUES ('player', 'Hello there', 'Good morning everybody'' at line 1
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 474 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)