Dear All,
I am currently working on an assignment.
I am having one error with this php file but I cannot figure out the problem.
Can you please help.

Fatal error: Function name must be a string in C:\xampp\htdocs\idareyou\searchUser.php on line 2

	if(!$con){die("could not connect".mysql_error());}
	echo("dbconnect is working");

	//echo "<br/>line just after include dbconnect";	
	//echo $fname;
	//$sql="SELECT fname,lname,email FROM user WHERE fname=$fname AND lname=$lname";
	$result=mysql_query("SELECT fname,lname,email FROM user WHERE fname='$fname' AND lname='$lname' ");
	//$result=mysql_query( "SELECT fname,lname,email FROM user WHERE".'"'.fname.'"'.=.'"'.$fname.'"');

	$numRows=mysql_num_rows($result);//echo $numRows;
		echo "No result found";
	 header('Content-Type: text/xml');
 $xml_name = '<?xml version="1.0" encoding="ISO-8859-1"?>';
 $xml_name = $xml_name."<Nom>" ;

	while($rows=mysql_fetch_array($result) ){
	echo $xml_name;

Recommended Answers

All 3 Replies

$_GET requires brackets [], not parenthesis (). It is an array, not a function.

Hello Dear,

$_GET is having a error in its parenthesis.Use $_GET fucntion like this

Welcome <?php echo $_GET["fname"]; ?>.<br />
You are <?php echo $_GET["age"]; ?> years old!

thanks again.
it worked !!

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.