Forum Moderators: coopster

Message Too Old, No Replies

Column count doesn't match value count at row 1

         

trive83

8:54 am on Feb 2, 2004 (gmt 0)



Hi all, I'm trying to use a menu script, the phpBB2 Main Menu with php nuke 6.9 version. You can see the entire script after my question. I've changed some parameters like links to the modules, name of the links and so on, and now every time that I try to load this block in my home page, the "Column count doesn't match value count at row 1 Column count doesn't match value count at row 1" comes on the bottom of the menù list. Every link and title is correct, so why this sentence comes every time? And only on the last tests, at the beginning everything was great...did I use an incorrect script? Can you tell me where to find a similar menu script?

Thanks,
Thomas

global $prefix, $dbi, $admin;

$result = sql_query("select main_module from ".$prefix."_main", $dbi);
list($main_module) = sql_fetch_row($result, $dbi);
$result = sql_query("select title from ".$prefix."_modules", $dbi);
while (list($title) = sql_fetch_row($result, $dbi)) {
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
sql_query("delete from ".$prefix."_modules where title='$title'", $dbi);
}
}

......removed a ton of display code....jatar_k

/* For Admin */
if (is_admin($admin)) {
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file)) ) {
$modlist .= "$file ";
}
}
closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i]!= "") {
$result = sql_query("select mid from ".$prefix."_modules where title='$modlist[$i]'", $dbi);
list ($mid) = sql_fetch_row($result, $dbi);
if ($mid == "") {
sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0')", $dbi);
}
}
}

......removed a few lines....jatar_k

$result = sql_query("select title, custom_title from ".$prefix."_modules where active='0' ORDER BY title ASC", $dbi);
while(list($mn_title, $custom_title) = sql_fetch_row($result, $dbi)) {

......removed a few more lines....jatar_k

[edited by: jatar_k at 7:43 pm (utc) on Feb. 2, 2004]
[edit reason] removed code dump [/edit]

isitreal

7:23 pm on Feb 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Not to ask the obvious, but when you changed this information like the link names and parameters, did you do a phpBB folder wide search and replace with something like dreamweaver to make sure you didn't miss something somewhere.

I was working a little on phpBB and found that was pretty effective when I was doing larger changes on it, since I had no idea where all the stuff actually was located.

jatar_k

7:52 pm on Feb 2, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld trive83,

I would think that error is coming from the insert statement.

if ($mid == "") {
sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0')", $dbi);
}

you need to take a look at the actual query and compare it with the table it is trying to insert into. I would guess that the number of params in the insert statement is wrong.