Can you spot the code error here ???
Can someone tell me why I'm getting the ERROR below with this code ?
$db->query_write("
INSERT INTO " . TABLE_PREFIX . "logins
(UserName, UserID, LoginDate)
VALUES
(" . $vbulletin->userinfo['username'] . ", " . $vbulletin->userinfo['userid'] . ", " . (!empty($post['moderateddateline']) ? $post['moderateddateline'] : TIMENOW) . ")
");
Database error in vBulletin 3.6.4:
Invalid SQL:
INSERT INTO forumlogins
(UserName, UserID, LoginDate)
VALUES
(MotoGal, 1, 1196252440);
MySQL Error : Unknown column 'MotoGal' in 'field list'
Error Number : 1054
Thanks !
--------------- Added [DATE]1196254482[/DATE] at [TIME]1196254482[/TIME] ---------------
For anyone who encounters this problem....
I changed the Query string as follows and now it works....
$db->query_write("
INSERT INTO " . TABLE_PREFIX . "logins
(UserName, UserID, LoginDate)
VALUES
('" . $db->escape_string($vbulletin->userinfo['username']) . "', " . $vbulletin->userinfo['userid'] . ", " . (!empty($post['moderateddateline']) ? $post['moderateddateline'] : TIMENOW) . ")
");
|