Jump to content

DELETE FROM problem


unistake

Recommended Posts

Hi all,

 

I have been trying to create a very simple php script to delete a users account however it doesnt appear to be that simple!

 

The $_SESSION[logname] is correct as it echos when asked for.

 

<?php 
session_start();
if (@$_SESSION['auth']!="yes") 
{ 
	header("Location:signin-redirect.php?page=my-account.php"); 
} 
else 
{
include("../cxnconnection.php");

mysql_query("DROP FROM Members WHERE email='$_SESSION[logname]'")
or die ("Cant delete Member where email is $_SESSION[logname]"); 

session_destroy();
unset($_SESSION);

header("Location:../index.html");

}

?>

 

Thanks for your help

Link to comment
Share on other sites

Thanks for your reply Mchl,

 

I have just changed the above script from

mysql_query("DROP FROM Members WHERE email='$_SESSION[logname]'")  to

mysql_query("DELETE FROM Members WHERE email='$_SESSION[logname]'")

 

I believe this is right but it is not working, do you know whats up with it?

 

Link to comment
Share on other sites

Still not working, my full code now is...

 

<?php 
session_start();
if (@$_SESSION['auth']!="yes") 
{ 
	header("Location:signin-redirect.php?page=my-account.php"); 
} 
else 
{
include("../cxnconnection.php");

mysql_query("DELETE FROM Members WHERE email='".$_SESSION['logname']."'")
or die ("Cant delete Member where email is $_SESSION[logname]"); 

session_destroy();
unset($_SESSION);

header("Location:../index.html");

}

?>

Link to comment
Share on other sites

You probably introduced a fatal parse error when you added the code incorrectly.

 

Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that all the errors php detects will be reported and displayed? You will save a ton of time.

Link to comment
Share on other sites

Hi PFMaBiSmAd,

 

I am trying to make a website on the go, I have made a few sites with php before but am struggling with this code.

 

I wouldnt know how to check the above! Sounds like thats just what i need. how do i check my php.ini?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.