|
|
| Author |
Message |
Seth Sandrino
New User
Joined: 12 Jan 2010
Posts: 22
|
Posted: February 17th 2010, 9:35 pm Post subject: SQL Error |
|
|
I'm having some trouble with some SQL that I can't figure out.
I'm getting this error:
| Code:
|
Couldn't insert ban_email info into database
DEBUG MODE
SQL Error : 1136 Column count doesn't match value count at row 1
INSERT INTO phpbb_banlist (ban_email, ban_reason, ban_until) VALUES ('test@yahoo.com', 'To test, 0')
Line : 310
File : admin_user_ban.php
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_email, ban_reason, ban_until)
VALUES ('" . str_replace("\'", "''", $email_list[$i]). "', '" . str_replace("\'", "''", $ban_reason) . ", " . $email_ban_until . "')";
|
From this code:
| Code:
|
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_email, ban_reason, ban_until)
VALUES ('" . str_replace("\'", "''", $email_list[$i]). "', '" . str_replace("\'", "''", $ban_reason) . ", " . $email_ban_until . "')";
|
(Although it shows it in the error so no suprise there)
As far as I know since I told it which 3 to enter the values in and it seems to have 3 values I cant figure out where the issue is....although I'm sure you all will.
Thanks once again, |
|
| Back to top |
|
 |
Wicher
Experienced User

Joined: 23 Apr 2003
Posts: 443
Location: Netherlands or Holland, your choice..
|
Posted: February 18th 2010, 12:48 pm Post subject: |
|
|
Replace the code in your second codeblock with following:
| Code:
|
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_email, ban_reason, ban_until)
VALUES ('" . str_replace("\'", "''", $email_list[$i]). "', '" . str_replace("\'", "''", $ban_reason) . "', " . $email_ban_until . ")";
|
It looks the same but its not. _________________ My little mods | Statistics Mod 4.x.x (revision of 2.1.5) | My hacks at phpbbhacks |
|
| Back to top |
|
 |
Seth Sandrino
New User
Joined: 12 Jan 2010
Posts: 22
|
Posted: February 23rd 2010, 8:04 pm Post subject: |
|
|
Thanks again Wicher.  |
|
| Back to top |
|
 |
Wicher
Experienced User

Joined: 23 Apr 2003
Posts: 443
Location: Netherlands or Holland, your choice..
|
|
| Back to top |
|
 |
Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 17279
Location: Harbinger, NC, U.S.A.
|
|
| Back to top |
|
 |
|