Firefox PHP

How to create message in mysql

Posted by tabby2 
How to create message in mysql
January 01, 2013 02:36PM
Hi all, how do I create message in mysql ?, I want to automatically create message for my phorum, from a sistersite I have.
Re: How to create message in mysql
January 03, 2013 01:20PM
Best would be to use the function
phorum_db_post_message
from the phorum database layer.
Its docs:
/**
 * Store a new message in the database.
 *
 * The message will not be posted if it is a duplicate and if
 * $PHORUM['check_duplicate'] is set.
 *
 * The $message is passed by reference and in case the function completes
 * successfully, the "message_id" index will be set to the new value.
 * If the "thread" index is set to zero, a new thread will be started and the
 * "thread" index will be filled with the new thread id upon return.
 *
 * @param array &$message
 *     The message to post. This is an array, which should contain the
 *     following fields: forum_id, thread, parent_id, author, subject, email,
 *     ip, user_id, moderator_post, status, sort, msgid, body, closed.
 *     Additionally, the following optional fields can be set: meta,
 *     modifystamp, viewcount, threadviewcount.
 *
 * @param boolean $convert
 *     True in case the message is being inserted by a database conversion
 *     script. This will let you set the datestamp and message_id of the
 *     message from the $message data. Also, the duplicate message check
 *     will be fully skipped.
 *
 * @return integer
 *     The message_id that was assigned to the new message.
 */


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Sorry, only registered users may post in this forum.

Click here to login