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();

?>

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

commented: man you help me soo much, thanks. +1

thanks heaps it works perfectly now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.