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
You need to use an alias. Use this:
$result = mysql_query("SELECT COUNT(fname) AS countfname,lname FROM a,b"); while ($row = mysql_fetch_array($result)) { echo ""; echo $row['lname']; echo ""; echo ""; echo $row['countfname']; echo ""; }