MyBB Community Forums

Full Version: [D] SQL error when giving warning in SQLite
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
MyBB Version: 1.4.4
SQLite Version: 2.8.17
Problem: When you warn a user, you get an SQL error.
The Error Message:
[attachment=12142]
To Reproduce: On a forum with the above requirements, either click the 'Warn' button in a post or click 'Warn' in the user's profile, enter the details, and click 'Warn User'.
Extra Info: Happens whether you use a custom reason or a preset one.
I love SQLite's error messages. They're so helpful Rolleyes
I'm about to push SQLite off a cliff...
D'you want me to stop finding SQLite problems?? Toungue

Shame the errors aren't very helpful, if there is any more info I could possibly give on any of the SQL errors, just ask...
(2008-12-24, 08:42 PM)MattR Wrote: [ -> ]D'you want me to stop finding SQLite problems?? Toungue

Shame the errors aren't very helpful, if there is any more info I could possibly give on any of the SQL errors, just ask...

No, keep on doing what your doing - this is great testing. I'll figure it out one way or another.
hmm not sure why this is happening either. It looks like it's failing on the tid constraint because it's passing it as a string and not a integer but we intval() the value which should be turning it into 0 anyway...

$new_warning = array(
	"uid" => $user['uid'],
	"tid" => intval($warning_type['tid']),
	"pid" => intval($post['pid']),
	"title" => $db->escape_string($warning_title),
	"points" => intval($points),
	"dateline" => TIME_NOW,
	"issuedby" => $mybb->user['uid'],
	"expires" => $warning_expires,
	"expired" => 0,
	"notes" => $db->escape_string($mybb->input['notes'])
);

warnings.php
Ah. That code is already in the SVN for 1.4.5. A similar error must have already been reported for MySQL Strict mode and fixed. If you test this on the SVN does it still happen?