how can i use while loop inside the select query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

how can i use while loop inside the select query

Post by manojsemwal1 »

hai everyone can u know how can i use while loop inside the select query.
my query are like
$sql3="SELECT University,
SUM(IF(Course = '$s1',1,0)) AS `s1`
FROM registeredstudenttb where Instid='$Sname'
GROUP BY University";

Here $s1 having multiple values.
i want result like
University | Courses |Total
Doeacc No of Student Total
MCRP No Of Student Total

regards,
Post Reply