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
<?php
$fme=$_GET('search_fname');
$lme=$_GET('search_lname');
$con=mysql_connect("localhost","root","");
if(!$con){die("could not connect".mysql_error());}
mysql_select_db("idareyou",$con);
echo("dbconnect is working");
//include('dbConnect.php');
mysql_select_db("idareyou",$con);
//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;
if($numRows<1){
mysql_close($con);
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) ){
$xml_name=$xml_name."<Name>";
$xml_name=$xml_name."<fname>".$rows["fname"]."</fname>";
$xml_name=$xml_name."<lname>".$rows["lname"]."</lname>";
$xml_name=$xml_name."<email>".$rows['email']."</email>";
$xml_name=$xml_name."</Name>";
}
$xml_name=$xml_name."</Nom>";
echo $xml_name;
mysql_close($con);
?>