I'm done with the whole PM system. Only thing that's not working is the delete conversation feature. Here's my delete_conversation function :
[syntax=php]function delete_conversation($conversation_id){
$conversation_id = (int)$conversation_id;
$sql = "SELECT DISTINCT `conversation_deleted`
FROM `conversations_members`
WHERE `user_id` != {$_SESSION['user_id']}
AND `conversation_id` = {$conversation_id}";
$result = mysql_query($sql);
if(mysql_num_rows($result) === 1 && mysql_result($result, 0) == 1){
mysql_query("DELETE FROM `conversations` WHERE `conversation_id` = {$conversation_id}");
mysql_query("DELETE FROM `conversations_members` WHERE `conversation_id` = {$conversation_id}");
mysql_query("DELETE FROM `conversations_messages` WHERE `conversation_id` = {$conversation_id}");
} else {
$sql = "UPDATE `conversations_members`
SET `conversation_deleted` = 1
WHERE `conversation_id` = {$conversation_id}
AND `user_id` = {$_SESSION['user_id']}";
mysql_query($sql);
}
}[/syntax]
My delete function doesn't work! (PM System)
My delete function doesn't work! (PM System)
Just A PHP Beginner!
-
- Posts: 205
- Joined: Mon Jul 09, 2012 11:13 pm
Re: My delete function doesn't work! (PM System)
[syntax=php]if(mysql_num_rows($result) === 1[/syntax]
One to many ='s here
One to many ='s here
<?php while(!$succeed = try()); ?>
Re: My delete function doesn't work! (PM System)
What is not working about it ? What does happen compared to what you expect ?