Hey guys i'm having trouble with php.
i made a script to check the database for simillar info and it was working fine until i added the " AND email = '$email ' " part in the mysql query . Now it just doesn't show anything ....no echo no nothing .

Anyway , here is the script

<?php
	require($_server["DOCUMENT_ROOT"]."/config/db_config.php");
	$connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
	mysql_select_db($db_name, $connection);
	
	$user = "mark";
	$email= " [email]mark@email.com[/email] ";
	
	
	
	$query = "SELECT user,email FROM `date` WHERE user = '$user' AND email = '$email'"; 
	
	$result = mysql_query($query) or die(mysql_error());
	$row = mysql_fetch_array($result) or die(mysql_error());
	   
	  echo "user=  " . $user . " the first echo <br> " ;
	
	
	if ($row[user]==$user)
	echo "the user found in the database is:  " .$user."<br>";
	else
	{
		if ($row[email]==$email)
		echo "the email found in the database is :   ".$email."<br>";
		else 
		echo "there is no user :". $user." or  email: ".$email." in the database";
	}
?>

i hope somebody out there has an ideea about what's going on :confused:
thanks a bunch in advance :icon_cheesygrin:

Recommended Answers

All 2 Replies

always try to use this method:

$query = "SELECT user,email FROM `date` WHERE user = '".$user."' AND email = '".$email."'";

The query seems ok to me. The reason for getting a blank page is an error here:

$email= " <a href="mailto:mark@email.com">mark@email.com</a> ";

. This gives PHP Parse error: syntax error, unexpected T_STRING It should be:

$email= "<a href=\"mailto:mark@email.com\">mark@email.com</a>";
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.