Problem beim Schreiben in Tabelle bei Move Mesage MOD
Verfasst: 28.08.2007 21:24
Hallo,
ich hab den MOD Move Message in mein Forum eingebaut.
Wenn ich jetzt einen beitrag verschieben will, bekomm ich folgende Error-Meldung.
Weis einer von euch an was das liegt?
PS: Ich hab schon rausbekommen, das es beim Verschieben daran liegt, das der Parameter $moved_oldtopic_id nicht mit '' in die Tabelle geschrieben werden kann.
Vielen Dank im Voraus.
mfg
n4426
ich hab den MOD Move Message in mein Forum eingebaut.
Wenn ich jetzt einen beitrag verschieben will, bekomm ich folgende Error-Meldung.
Ähnlich siehts beim Sperren aus.Could not insert data into moved table
DEBUG MODE
INSERT INTO phpbb_topic_moved (moved_topic_id, moved_oldtopic_id, moved_type, moved_parent, moved_target, moved_mod, moved_time, last_post_id) VALUES ('12', '', 'move', '8', '2', '3', '1188328825', '14')
Line : 37
File : move_message_mod.php
Hier noch die datei move_message_mod.phpCould not insert data into moved table
DEBUG MODE
SQL Error : 1366 Incorrect integer value: '' for column 'moved_oldtopic_id' at row 1
INSERT INTO phpbb_topic_moved (moved_topic_id, moved_oldtopic_id, moved_type, moved_parent, moved_target, moved_mod, moved_time, last_post_id) VALUES ('12', '', 'lock', '', '', '3', '1188328889', '14')
Line : 37
File : move_message_mod.php
Code: Alles auswählen
<?php
if (!defined('IN_PHPBB'))
{
die('Hacking attempt');
}
function move_message_mod($moved_topic_id, $moved_oldtopic_id, $type, $moved_parent, $moved_target, $moved_mod)
{
global $db;
if($type == 'split')
{
$where = "WHERE topic_id = '$moved_oldtopic_id'";
}
else
{
$where = "WHERE topic_id = '$moved_topic_id'";
}
$sql = "SELECT topic_last_post_id
FROM ". TOPICS_TABLE ."
$where";
if(!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not get topic_last_post_id', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$last_post_id = $row['topic_last_post_id'];
$time = time();
$sql = "INSERT INTO ". MOVED_TABLE ." (moved_topic_id, moved_oldtopic_id, moved_type, moved_parent, moved_target, moved_mod, moved_time, last_post_id)
VALUES ('$moved_topic_id', '$moved_oldtopic_id', '$type', '$moved_parent', '$moved_target', '$moved_mod', '$time', '$last_post_id')";
if(!($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into moved table', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE ". POSTS_TABLE ." SET
post_move = '1'
WHERE post_id = '$last_post_id'";
if(!($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql);
}
}
function delete_topic($topic_id)
{
global $db;
$sql = "DELETE FROM ". MOVED_TABLE ."
WHERE moved_topic_id = '$topic_id'";
if(!$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete move message', '', __LINE__, __FILE__, $sql);
}
}
?>
PS: Ich hab schon rausbekommen, das es beim Verschieben daran liegt, das der Parameter $moved_oldtopic_id nicht mit '' in die Tabelle geschrieben werden kann.
Vielen Dank im Voraus.

mfg
n4426