$sql="SELECT marks FROM marks WHERE uname='$uname' && tname='$tname'";
echo $marks;
echo $uname;
echo $tname;

When I am trying to retrieve data marks is not retrived its displaying as "Marks" Please help

Member Avatar

You need to use

$d = mysql_fetch_assoc($data);
$marks = $d['marks'];

$data is a result object. You have to fetch array from it like follows

$row = mysql_fetch_array($data, MYSQL_ASSOC);
$marks = $row['marks'];
echo $marks;

OR you can replace $row = mysql_fetch_array($data, MYSQL_ASSOC); by $row = mysql_fetch_assoc($data);