Skip to:

Re: Plugin – Private Messages

Ok…I fixed the other errors (still waiting for Ardenfrost to see if they will work or if there is a better way), but I can’t get rid of the following error when I post or reply:

bbPress database error: [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 '19:54:11' at line 1]

SELECT * FROM bb_privatemessages WHERE id_sender = 14 AND created_on = 2006-12-09 19:54:11

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/forum/bb-includes/db.php:147) in /var/www/html/forum/bb-includes/pluggable.php on line 160

The error is generated from the following code in the plugin itself:

function pm_new_message( $id_receiver, $id_sender, $pmtitle, $message ){

global $bbdb, $bb_table_prefix;

$created_on = bb_current_time('mysql');

$bbdb->query("INSERT INTO ".$bb_table_prefix."privatemessages

(id_sender, id_receiver, pmtitle, message, created_on)


('$id_sender', '$id_receiver', '$pmtitle', '$message','$created_on')");

$rmess = $bbdb->get_row("SELECT * FROM ".$bb_table_prefix."privatemessages WHERE id_sender = $id_sender AND created_on = $created_on");

return $rmess->pm_id;


I would ask anyone that might have an idea for me here to let me know. It doesn’t have a problem with the bb_current_time for posting normally, so I can’t understand why it doesn’t like the timestamp on this one. I have mySQL 4.1.21.


Skip to toolbar