PDA

View Full Version : Forum SQL Error...


Boofo
07-21-2002, 12:34 AM
I just got this mysql error when I tried to add a new forum. Can anyone please tell me what it means and how to correct it?

Database error in vBulletin Control Panel 2.2.5:

Invalid SQL: INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,iconimg, daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch)
VALUES
(NULL,'1','Memeber Introductions','Tell us a little about yourself and get to know other memebers.','1','1','1',
'','1','1','',
'','30','','',
'0','0','1','0','1','1',
'0','1','1','0')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Sunday 21st of July 2002 01:29:40 AM
Script: http://www.bearfacts2.com/forum/forum/admin/forum.php
Referer: http://www.bearfacts2.com/forum/admin/forum.php?action=add&parentid=1

Admin
07-21-2002, 05:18 AM
Paste here the line from forum.php that STARTS with:
$DB_site->query("INSERT INTO forum

Boofo
07-21-2002, 05:31 AM
Here is the code you asked for:

$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,iconimg,
daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','".addslashes($iconimg)."',
'".addslashes($sponsorurl)."','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach')");

If I read this right (and I am only guessing because I'm not sure what it all means :)), there is an extra item in the second part. I *think* it is the '".addslashes($sponsorurl)."' part. The hack involved is the forum category icons so I'm not sure why that part is even in there. When I did a search in the my whole hack directory, there is only once instance of that code and this is where it is at. Doesn't make any sense to me. :) I tried removing it and everything works again, but is it something I need somewhere or is it kindof redundant without anything being in the first part of the code to go with it? This one has me puzzled. :)

Admin
07-21-2002, 05:38 AM
This will work:
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,iconimg,
daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','".addslashes($iconimg)."',
,'$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach')");
But it will break the hack you have wiht sponsorurl.

Boofo
07-21-2002, 06:06 AM
That's the wierd thing about it. After reviewing all the hacks I have installed, that one spot with the sonsorurl is the only place it is at and it is in the forum cateorgy icons hack. Here is the code he says to replace:

************************************************** **********
Still in forum.php, replace:
************************************************** **********
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','$daysprun e','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach')");

And here is the code he says to replace it with:

with:
****************
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,iconimg,
daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','".addslashes($iconimg)."',
'".addslashes($sponsorurl)."','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach')");

It doesn't make sense, does it? :)

Boofo
07-21-2002, 06:12 AM
Is there suppsed to be 2 commas between '".addslashes($iconimg)."' and '$daysprune'? You have 2 of them in the fixed code you gave me. :)