Delete records

Started on the old forum in August 2013 · view the original in the archive · old links redirect here

4 replies · 305 views · started 13 years ago · 1 min read

3 participants
ares1981 Junior · 25 posts #1

Hi all

I have a site with regesterd members but I don't have a button for them to deleite there account,

need some code dudes.

hes what I got just not working ..........................

code try 1

if(isset($_POST['delete'])) {

   $getuserinfo="SELECT * from b_users where username='$SESSION";
   $getuserinfo="SELECT * from wp_users where user_login='$SESSION'";
   $getuserinfo="SELECT * from usersgnet where name='$SESSION'";


	 $delname="DELETE from wp_users where user_login='$SESSION'";
     mysql_query($delname)  or die(mysql_error());
	 
     $delname="DELETE from usersgnet where name='$SESSION'";
     mysql_query($delname)  or die(mysql_error());

     $deluser="DELETE from b_users where username='$SESSION'";
     mysql_query($deluser) or die("Could not delete user");
     print "User deleted";

Code try 2

$emp_id = $_SESSION['user'];

$sql = "DELETE * form usersgnet". "WHERE emp_id = $name" ;

mysql_select_db('gnetuk_net'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not delete data: ' . mysql_error()); } echo "Deleted data successfully\n"; mysql_close($conn);

peace

ares1981 Junior · 25 posts #4

ok thanks all

i found it out in the end thanks XD

but how do i delete a record that matches a record from another table?

anyone got this?

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close