here is my code i and got this error while running it

Notice: Undefined index: Reg_no in D:\wamp\www\mohammed\geo.php on line 12

Notice: Undefined index: Reg_no in D:\wamp\www\mohammed\geo.php on line 12
mysql_connect("localhost","root","");
mysql_select_db("new");

$query= "SELECT SUM(Reg_no)+SUM(class) FROM fee_info GROUP BY Reg_no";

$result = mysql_query($query) or die(mysql_error());

// Print out result
while($row = mysql_fetch_array($result)){
//	echo "Total ". $row['Reg_no']. " = $". $row['sum(class)'];
	
	$new=$row['Reg_no'];
echo "$new";
}

If you do not specify an AS clause in your field content description, the row index will be the same as the content description itself.
But your query does not make sense in the first place. Test it against your database without PHP (from the command line) and you will see that you get nonsensical results.
You are selecting only one column per row SUM(Reg_no)+SUM(class) , but in your printout you refer to two columns ( Reg_no and sum(class) ) which are both not part of your select query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.