MyBB Community Forums

Full Version: Error in PMs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
I get this error message when I am in Private Messages, and I click on Sent Messages. It sortof makes sense, but not enough for me to know what to do. I could use some expert help.
_____________________________________________Message:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Thomas,Guest)' at line 1
Query:
SELECT uid, username, usergroup, displaygroup FROM mybb_users WHERE uid IN (15,89,126,khoward,mike327,Mallcrawler,Clinton Thomas,Guest)
Yes, I have.
None of the old PM show up.
The avatars and sig pics did not show up.

That's O.K., though. no one is complaining because the board is so awesome!
Thanks for the link to the fix. I didn't think to look in the Merge section.
It says to "run it". I figured out how to bring it up in my browser and read it, but how, exactly, do I run it?
Somebody? (please.) A clue?
How or where do i "run" this? In MyPhpAdmin?
Yes, all queries are run in phpMyAdmin.
Thanks so much. I have never done that, but i have seen where you do, so I will give it a shot.
Sorry for asking such basic questions. Is there someplace else I should be looking for such information?
I brought up the privatemessages table and took a shot at running the query. (never done this before.) When I copy and paste the script in the query window I get a syntax error. Here is what I am pasting:

<?php
/**
* Fix for bug in Beta 5 of merge system where the username of the user was in the recicpents field of the privatemessages table instead of the UID, causing an SQL error when viewing the Sent folder in your UserCP.
* This is not a fix for the merge system itself, it fixes the problem in the privatemessages table after the merge has been performed.
* Backup privatemessages table first.
* Delete this file after you have run it.
* MattRogowski 22/08/09
**/
define("IN_MYBB", 1);
require_once "./global.php";
set_time_limit(0);

$select_users = $db->simple_select("users", "uid, username");

while ($user = $db->fetch_array($select_users))
{
$uid = $db->escape_string('"'.$user['uid'].'"');
$username = $db->escape_string('"'.$user['username'].'"');

$db->write_query(
"UPDATE ".TABLE_PREFIX."privatemessages
SET recipients = REPLACE(recipients, '$username', '$uid')
WHERE recipients LIKE '%$username%';"
);
}
?>

Here is the error that I get:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php /** * Fix for bug in Beta 5 of merge system where the username of the u' at line 1

My server is running:

Operating System CentOS release 5.4 (Final)
Kernel Version 2.6.18-164.11.1.el5PAE
Apache Version 2.2.3
MySQL Version 5.0.77
PERL Path /usr/bin/perl
PERL Version 5.8.8
PHP Path /usr/bin/php
PHP Version 5.2.9


I know nothing about editing script, so I tried getting rid of the text, deleting some asterisks, etc. I keep getting errors. What should I change?
(humble bump) Maybe I can pay someone to help me?
You don't run that in phpMyAdmin. You upload it to your forum's directory on the server and run it from the web address.
:| I don't know why I thought there was a single query to run, got confused with something else. My apologies!!
Poor Matt, so many things to keep track of Big Grin
Pages: 1 2 3 4