0

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:

Edited by nav33n: Please use [code][/code] tags to wrap your code for easy readability.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by colweb
0

always try to use this method:

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

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>";
This topic has been dead for over six months. 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.