MyBB Community Forums

Full Version: Inseting users ;\
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
so i have a problem when i try to inset users:

Column count doesn't match value count at row 1

if(isset($_GET['step1']))
{
$filename = "../ucoz/_s1/users.txt";

$fd = fopen($filename, "r");

$i = 0;

mysql_query("SET CHARACTER SET cp1251");

echo "<br>";
	while (!feof ($fd)) 
		{
 
			$bufer[$i] = fgets($fd, 4096);
			
			$bufer[$i] = iconv("UTF-8", "Windows-1251", "$bufer[$i]");
			 			
			$arr = explode("|", $bufer[$i]);
	
			$i++;
			if($arr[0] != ""){
			
			$query = "INSERT IGNORE INTO mybb_users(`username`, `password`, `salt`, `email`, `postnum`, `avatar`, `usergroup`, `usertitle`,`regdate`, `icq`, `regip`, `lastip`, `showcodebuttons`) VALUES
('$arr[0]', '$arr[2]', '$arr[1]', '$arr[6]', '0' '$arr[3]', '2', '$arr[14]', '$arr[15]', '$arr[9]', '$arr[16]' , '$arr[16]','1');
";

			$result = mysql_query($query)or die(mysql_error());  
;
			
		 echo "<textarea name=\"html\" style=\"width:600px; height:100px\" cols=\"60\" rows=\"5\" tabindex=\"1\">
user «$arr[0]» has been inserted	</textarea>";
			 }
			
		}

i changed with:
			$query = "INSERT IGNORE INTO mybb_users(uid,`username`, `password`, `salt`, `email`, `postnum`, `avatar`, `usergroup`, `usertitle`,`regdate`, `icq`, `regip`, `lastip`, `showcodebuttons`) VALUES
('', '$arr[0]', '$arr[2]', '$arr[1]', '$arr[6]', '0' '$arr[3]', '2', '$arr[14]', '$arr[15]', '$arr[9]', '$arr[16]' , '$arr[16]','1');
";
and i get the same error :\
Use INSERT INTO rather then to use INSERT IGNORE INTO