php - Delete Individual Conversations Between Users -


i have created private message system social media network users, similar facebook.

pretty much, want work facebook... click on user , view conversation, , able delete conversation user.

i tried several ways, , first php script deletes private coversations, between users they've had conversation instead of individual conversations...

here's php deletes 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 messages  timeline_id='".$_request['timelineid']."'");    $query1=mysql_query("delete messages  recipient_id='".$_request['timelineid']."'");    header("location:index.php?tab1=messages");    ?> 

but, said, need way user delete individual conversations, tried doing way, doesn't work:

here's 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 messages timeline_id='".$_request['timelineid']." , recipient_id=" .  $_request['recipientid']);    header("location:index.php?tab1=messages");    ?>           

any ideas, or doing wrong? thanks!

you got mysql syntax error because half-wrapping arguments inside 1 single quotation mark.

replace line

$query1=mysql_query("delete messages timeline_id='".$_request['timelineid']." , recipient_id=" .  $_request['recipientid']); 

with this

$query1=mysql_query("delete messages timeline_id='".$_request['timelineid']."' , recipient_id='" .  $_request['recipientid']."'"); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -