Jump to content

deleting delete from database


zhshero

Recommended Posts

i trying to delete messages out of my message database but im not sure if i'm using this code right

or there stuff missing to it :S

 

delete.php

<?php 
require_once('settings.php');
checkLogin('1 2');

$id=$_GET["msgs"];
mysql_query("DELETE messages FROM messages WHERE message_id='$id'");
?>

 

link usages to delete

<a href="delete.php?msgs=<? echo $row['message_id']  ?>">[X]</a>

Link to comment
https://forums.phpfreaks.com/topic/218794-deleting-delete-from-database/
Share on other sites

i re did it, had to add the userfinal but not sure if I'm using it right

 

<?php 

require_once('../settings.php');
checkLogin('1 2');

$userfinal = get_main_P($_SESSION['user_id']);


$id=$_GET["msgs"];
mysql_query("DELETE FROM messages WHERE message_id='$id' AND to_user = '$userfinal'");
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.