I have created a private message system for my social media network for my users, which is similar to Facebook.
Pretty much, I want it to work like Facebook... Click on the user and view the conversation, and be able to delete just that conversation with just that user.
I tried several ways, and my first php script deletes ALL private coversations, between ALL users they've had a conversation with instead of individual conversations...
Here's my php that deletes ALL conversations:
<?php
error_reporting(0);
include "assets/includes/config.php";
$conn=mysql_connect($sql_host,$sql_user,$sql_pass);
mysql_select_db($sql_name,$conn);
$query1=mysql_query("DELETE FROM messages where timeline_id='".$_REQUEST['timelineID']."'");
$query1=mysql_query("DELETE FROM messages where recipient_id='".$_REQUEST['timelineID']."'");
header("location:index.php?tab1=messages");
?>
But, like I said, I need a way for a user to delete individual conversations, so I tried doing it this way, but it doesn't work:
Here's my php:
<?php
error_reporting(0);
include "assets/includes/config.php";
$conn=mysql_connect($sql_host,$sql_user,$sql_pass);
mysql_select_db($sql_name,$conn);
$query1=mysql_query("DELETE FROM messages where timeline_id='".$_REQUEST['timelineID']." AND recipient_id=" . $_REQUEST['recipientID']);
header("location:index.php?tab1=messages");
?>
Any ideas, or am I doing something wrong? Thanks!