Insert query error
Posted: Tue Apr 14, 2009 12:13 pm
Sometimes i feel like breaking my PC coz of these errors
DEBUG MODE
THe query i'm trying to execute
TABLE STRUCTURE
P.S what i dont understand is the double quotes that is displayed in the DEBUG mode where have they come from 
error:
Could not insert data into users table
DEBUG MODE
Code: Select all
INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_interests, user_viewemail, user_allowhtml, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_dateformat, user_level, user_allow_pm, user_active, user_actkey) VALUES (8, 'researcher', 1239730941, '81dc9bdb52d04dc20036dbd8313ed055', 'p@p.com', ","0","1, 1, 0, 1, 1, 'D M d, Y g:i a', 0, 1, 1, ")
Code: Select all
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_interests, user_viewemail, user_allowhtml, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_dateformat, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $interests) . "','" . "'$viewemail'" . "','" . "'$allowhtml, $allowviewonline, $notifyreply, $notifypm, $popup_pm, '" . str_replace("\'", " '' ", $user_dateformat) . "', 0, 1, ";Code: Select all
CREATE TABLE phpbb_users (
user_id mediumint(8) NOT NULL,
user_active tinyint(1) DEFAULT '1',
username varchar(25) NOT NULL,
user_password varchar(32) NOT NULL,
user_session_time int(11) NOT NULL DEFAULT '0',
user_session_page smallint(5) NOT NULL DEFAULT '0',
user_lastvisit int(11) NOT NULL DEFAULT '0',
user_regdate int(11) NOT NULL DEFAULT '0',
user_level tinyint(4) DEFAULT '0',
user_posts mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
user_dateformat varchar(14) NOT NULL DEFAULT 'd M Y H:i',
user_new_privmsg smallint(5) UNSIGNED NOT NULL DEFAULT '0',
user_unread_privmsg smallint(5) UNSIGNED NOT NULL DEFAULT '0',
user_last_privmsg int(11) NOT NULL DEFAULT '0',
user_login_tries smallint(5) UNSIGNED NOT NULL DEFAULT '0',
user_last_login_try int(11) NOT NULL DEFAULT '0',
user_emailtime int(11) DEFAULT NULL,
user_viewemail tinyint(1) DEFAULT NULL,
user_allowhtml tinyint(1) DEFAULT '1',
user_allow_pm tinyint(1) NOT NULL DEFAULT '1',
user_allow_viewonline tinyint(1) NOT NULL DEFAULT '1',
user_notify tinyint(1) NOT NULL DEFAULT '1',
user_notify_pm tinyint(1) NOT NULL DEFAULT '0',
user_popup_pm tinyint(1) NOT NULL DEFAULT '0',
user_rank int(11) DEFAULT '0',
user_email varchar(255) DEFAULT NULL,
user_interests varchar(255) DEFAULT NULL,
user_actkey varchar(32) DEFAULT NULL,
user_newpasswd varchar(32) DEFAULT NULL,
PRIMARY KEY (user_id),
KEY user_session_time (user_session_time)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;