I had a file info.php with class named xyz and functions within it, I am trying to fetch data from data base from another file show.php..but it is not working and shows "Notice: Undefined variable $info"....is there any help wht am i doing wrong...
my code is..
in dblink() // i make mysql conn and chose my database
in realescapestring() // perform stripslash and mysql_real_escape_string
class name is xyz
function showingdta($cuid) /*user info*/
{
$table2="member_info";
if($this->dblink()==TRUE)
{
$query='SELECT * FROM '. $table2 .' WHERE EMAIL= "'.$this->realescapestring($cuid).'"';
$result=mysql_query($query,$this->conn_link) or die("prob");
$info=mysql_fetch_array($result);
if (mysql_error())
{ print "Database ERROR: " . mysql_error(); }
header("Content-type: $info");
echo $info;
}
else
{return FALSE;}
}
in show.php file
<?php
session_start();
include_once("info.php");
$biglife= new xyz;
$cuid=100011;
$biglife->showingdta($cuid);
echo "<table>";
echo "<tr>";
echo "<td>Name:</td>";
echo "<td> " . $info['FIRST_NAME']. " </td>";
echo "</tr>";
echo "</table>";
?>