gpt4 book ai didi

php - CodeIgniter 没有正确执行 sql 查询

转载 作者:太空宇宙 更新时间:2023-11-03 11:10:41 24 4
gpt4 key购买 nike

在 Ci 中我收到以下错误:

A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '', '1f37540fc54292b018a9e993da38cb5647dc5587', NOW(), '0')' at line 1

INSERT INTO users (userpid, Email, Password, dateTimeRegistered, isLeader) VALUES ('147344f0e33367f9e6', erf', '1f37540fc54292b018a9e993da38cb5647dc5587', NOW(), '0')

Filename: C:\Workspace\htdocs\Misc-2\DruvlaCi-1\system\database\DB_driver.php

Line Number: 330

但是在 SQL 查询中似乎一切都是正确的。以下是我的查询,有什么想法吗?

$query = $this->db->query("INSERT IGNORE INTO users (userpid, Email, Password, dateTimeRegistered, isLeader) VALUES ('{$idgen}', {$postedEmail}', '{$hashedPass}', NOW(), '0')");

最佳答案

您忘记了电子邮件列的开头单引号

试试这个

$query = $this->db->query("INSERT IGNORE INTO users (userpid, Email, Password, dateTimeRegistered, isLeader) VALUES ('{$idgen}', '{$postedEmail}', '{$hashedPass}', NOW(), '0')");

关于php - CodeIgniter 没有正确执行 sql 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8835695/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com