<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[elimina chat utente loggato]]></title><description><![CDATA[<p dir="auto">buongiorno sto tentando di eliminare due tabelle ho provato cosi ma non va <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=f1cecb658d8" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /> :</p>
<pre><code>CREATE TABLE `chats` (
  `chat_id` int(11) NOT NULL,
  `from_id` int(11) NOT NULL,
  `to_id` int(11) NOT NULL,
  `message` text NOT NULL,
  `opened` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

--
-- Table structure for table `conversations`
--

CREATE TABLE `conversations` (
  `conversation_id` int(11) NOT NULL,
  `user_1` int(11) NOT NULL,
  `user_2` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-----------------------------------------------------------
&lt;?php  

session_start();

# check if the user is logged in
if(isset($_POST['del'])){
	
	# database connection file
	include 'app/db.conn.php';

	# get the logged in user's username from SESSION
	$user_id = $_SESSION['user_id'];
	$chat_id = $_POST['chat_id'];
	$conversation_id = $_POST['conversation_id'];

$sql = "DELETE chats,conversations
  FROM chat_id AS chats
  LEFT JOIN conversation_id AS conversations ON chat_id.from_id = conversation_id.conversation_id
  WHERE chat_id.from_id = 2;'");
$stmt= $conn-&gt;prepare($sql);
$stmt-&gt;execute([$chat_id, $conversation_id]);


	header("Location: home.php");
	exit;
}

?&gt;
&lt;form action="delchat.php" method="post" enctype="multipart/form-data"&gt;
&lt;input type="hidden" value="&lt;?=$user['username']?&gt;"&gt;  
&lt;input type="submit" name="del" value="Elimina chat"&gt;
&lt;/form&gt;



</code></pre>
]]></description><link>https://dev.connect.gt/topic/250351/elimina-chat-utente-loggato</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 09:16:40 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/250351.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 May 2023 10:50:38 GMT</pubDate><ttl>60</ttl></channel></rss>