0

Can anyone tell me why this code isnt working?

<?php
	$username = 
	$password = 
	$database = 
	
	$email23 = $_POST['email'];

	$con = mysql_connect('localhost',$username,$password);
	@mysql_select_db($database) or die( "Unable to select database");
	$sql = "SELECT * FROM `user_user` WHERE `email` = '$email23'";
	$query = mysql_query($sql) or die('Error: ' . mysql_error());
	$r = mysql_fetch_row($query);
	
	$id = $r['id'];
	
	$sql2 = "DELETE FROM `user_user` WHERE `id` = '$id' ";
	$query = mysql_query($sql2) or die('Error: ' . mysql_error());
	
	$sql2 = "DELETE FROM `listuser` WHERE `userid` = '$id' ";
	$query = mysql_query($sql2) or die('Error: ' . mysql_error());

mysql_close();

?>
2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Scottmandoo
1

Because you are using mysql_fetch_row and trying to use the associated name. Use mysql_fetch_array instead.

Votes + Comments
man you help me soo much, thanks.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.