BigJohnson
06-19-2002, 09:46 PM
Database error in vBulletin Control Panel 2.2.5:
Invalid SQL: INSERT INTO user (userid,usergroupid,username,password,email,stylei d,parentemail,coppauser,homepage,icq,aim,yahoo,sig nature,adminemail,receivebulletin,receivebulletin_ type,showemail,invisible,usertitle,customtitle,joi ndate,cookieuser,daysprune,lastvisit,lastactivity, lastpost,posts,storep,timezoneoffset,emailnotifica tion,receivepm,emailonpm,ipaddress,pmpopup,options ,birthday) VALUES (NULL,'9','Guest','adb831a7fdd83dd1e2a309ce7591dff 8','.com','1','None@none.com','0','http://.com','None','None','None','I am a Guest','0','0','0','0','Geust','1',1024525836,'0', '-1',1024525836,1024525836,1024525836,'0','0','0','0 ','0','0','','0','0','1986/10/13')
mysql error: Column count doesn't match value count at row 1
mysql error number: 1136
Date: Wednesday 19th of June 2002 06:30:36 PM
Script: /messageboard/admin/user.php
Referer: /messageboard/admin/user.php?action=add
I tried making a new user in the Admin section and this is what i got when i filled the info and i click send. What is wrong?
BigJohnson
06-20-2002, 06:26 PM
HEre is some code i think that might help. This is a part of the code in the user.php
Please help me out.
// ###################### Start add #######################
if ($action=="add") {
echo "Add New User";
doformheader("user","insert");
maketableheader("User Profile");
makechoosercode("User Group","usergroupid","usergroup",2);
makeinputcode("User Name","ausername");
makeinputcode("Password","apassword");
makeinputcode("Email Address","email");
makeinputcode("User Title","usertitle");
makeyesnocode("Use Custom Title<br><font size='1'>(This forces the title that you put in the field above to be used)</font>","customtitle",0);
makestylecode("Style set","userstyleid",$user[styleid]);
makeinputcode("Home Page","homepage","http://www.");
makeinputcode("Birthday<br>(Format yyyy-mm-dd)","birthday");
// Country Hack CP Addon by Stasik (modded by AJ)
echo "<tr class='".getrowbg()."'><td>Country Flag</td><td nowrap>";
eval("\$countrytext.= \"".gettemplate("modifyprofile_country")."\";");
echo "$countrytext</td></tr>";
// Country Hack CP Addon End
maketextareacode("Signature","signature","",8,45);
makeinputcode("ICQ Number","icq");
makeinputcode("AIM Handle","aim");
makeinputcode("Yahoo Messenger Handle","yahoo");
makeyesnocode("COPPA user","coppauser",0);
makeinputcode("Parent Email Address","parentemail");
maketableheader("Options");
makeyesnocode("Receive mailings from admins","adminemail",1);
makeyesnocode("Receive Community Bulletin Email","receivebulletin",1);
makeyesnocode("Receive Community Bulletin Email Type (Yes = HTML, No = Text)","receivebulletin_type",1);
makeyesnocode("Show email address","showemail",1);
makeyesnocode("Invisible on 'Online users' list","invisible",0);
makeyesnocode("Receive PMs","receivepm",1);
makeyesnocode("Email on PM","emailonpm",0);
makeyesnocode("PM Popup","pmpopup",0);
makeyesnocode("Show Signatures","showsignatures",1);
makeyesnocode("Show Avatars","showavatars",1);
makeyesnocode("Show Images","showimages",1);
makeyesnocode("Show VBcode","showvbcode",1);
makeyesnocode("Use email notification by default","emailnotification",1);
makeyesnocode("Remember Username and password","cookieuser",1);
makeyesnocode("Browse boards with cookies","nosessionhash",1);
makeinputcode("Join Date<br>(Format yyyy-mm-dd, leave blank for today)","joindate");
makeinputcode("Default view age<br>'Select threads from last x days'<br>Recommended values: 1, 2, 5, 10, 20, 30, 45, 60, 75, 100, 365, 1000 (ie all). -1 gives default forum selection","daysprune","-1");
makeinputcode("Last Visit<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)","lastvisit");
makeinputcode("Last Activity<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)","lastactivity");
makeinputcode("Last Post<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)","lastpost");
makeinputcode("Number of Posts","posts","0");
makeinputcode("Number of Points","storep","0");
makeinputcode("Time Zone Offset (hours)","timezoneoffset","0");
makeinputcode("IP Address","aipaddress",$ipaddress);
maketableheader("Custom Profile Fields");
$profilefields=$DB_site->query("SELECT profilefieldid,title FROM profilefield");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
makeinputcode($profilefield[title],"field".$profilefield[profilefieldid]);
}
doformfooter("Save");
}
// ###################### Start insert #######################
if ($HTTP_POST_VARS['action']=="insert") {
if (!isset($ausername) or $ausername == '') {
echo "<p>You did not give this user an username</p>";
exit;
}
if ($exists=$DB_site->query_first("SELECT userid FROM user WHERE username='".addslashes(htmlspecialchars($ausername))."'")) {
echo "There is already an ".makelinkcode('user',"user.php?do=edit&userid=$exists[userid]",1)." named <b>".htmlspecialchars($ausername)."</b>";
exit;
}
if (!isset($apassword) or $apassword == '') {
echo "You did not give this user a password";
exit;
}
if ($joindate=="") {
$joindate=time();
} else {
$joindate="UNIX_TIMESTAMP('".addslashes($joindate)."')";
}
if ($lastvisit=="") {
$lastvisit=time();
} else {
$lastvisit="UNIX_TIMESTAMP('".addslashes($lastvisit)."')";
}
if ($lastactivity=="") {
$lastactivity=time();
} else {
$lastactivity="UNIX_TIMESTAMP('".addslashes($lastactivity)."')";
}
if ($lastpost=="") {
$lastpost=time();
} else {
$lastpost="UNIX_TIMESTAMP('".addslashes($lastpost)."')";
}
if ($biography=="Location:\r\nOccupation:\r\nInterests:\r\n") {
$biography="";
}
/* remove because it did not like 0000 as year-J $temp = explode("-", $birthday);
if ((!checkdate($temp[1],$temp[2],$temp[0]))||(!ereg("^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$",$birthday)))
$birthday = 0; */
$options=iif($showsignatures==1,SHOWSIGNATURES,0);
$options+=iif($showavatars==1,SHOWAVATARS,0);
$options+=iif($showimages==1,SHOWIMAGES,0);
$options+=iif($showvbcode==1,SHOWVBCODE,0);
$DB_site->query("INSERT INTO user (userid,usergroupid,username,password,email,stylei d,parentemail,coppauser,homepage,icq,aim,yahoo,sig nature,adminemail,receivebulletin,receivebulletin_ type,showemail,invisible,usertitle,customtitle,joi ndate,cookieuser,daysprune,lastvisit,lastactivity, lastpost,posts,storep,timezoneoffset,emailnotifica tion,receivepm,emailonpm,ipaddress,pmpopup,options ,birthday) VALUES (NULL,'$usergroupid','".addslashes(htmlspecialchars($ausername))."','".addslashes(md5($apassword))."','".addslashes(htmlspecialchars($email))."','$userstyleid','".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$receivebulletin','$showemail','$ invisible','".addslashes($usertitle)."','$customtitle',$joindate,'$cookieuser','$dayspru ne',$lastvisit,$lastactivity,$lastpost,'$posts','$ storep','$timezoneoffset','$emailnotification','$r eceivepm','$emailonpm','".addslashes($aipaddress)."','$pmpopup','$options','$birthday')");
$userid=$DB_site->insert_id();
$userfields="";
$userfieldsnames="(userid";
$profilefields=$DB_site->query("SELECT maxlength,profilefieldid,title
FROM profilefield
ORDER BY displayorder");
while ($profilefield=$DB_site->fetch_array($profilefields)) {
$varname="field$profilefield[profilefieldid]";
$userfieldsnames.=",field$profilefield[profilefieldid]";
$userfields.=",'".addslashes(htmlspecialchars($$varname))."'";
}
$userfieldsnames.=')';
$DB_site->query("INSERT INTO userfield $userfieldsnames VALUES ($userid$userfields)");
$action="modify";
echo "<p>Record added</p>";
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.