I am trying to execute this query but i got error \" Undefined index: lname\".I want to count row from one column(fname) from table a and select column(ln
Try this code:
$result = mysql_query("SELECT COUNT(a.fname) as fname,b.lname as lname FROM a,b"); while ($row = mysql_fetch_array($result)) { echo ""; echo $row['lname']; echo ""; echo ""; echo $row['COUNT(fname)']; echo ""; }