HEllo everyone, i have an inner join Select statement that works great in my sql editor, but when I combine it with the PHP code (a while loop) it comes out NULL.
Does anybody have any ideas why???
Here is the code.
$query = "SELECT DISTINCT program.program_name FROM program INNER JOIN schedule ON program.id = schedule.pid ";
$result = mysql_query($query, $user_login) or die(mysql_error());
while ($row = mysql_fetch_assoc($result));
{
echo $row['program_name'];
}
Does anybody have any ideas why???
Here is the code.
$query = "SELECT DISTINCT program.program_name FROM program INNER JOIN schedule ON program.id = schedule.pid ";
$result = mysql_query($query, $user_login) or die(mysql_error());
while ($row = mysql_fetch_assoc($result));
{
echo $row['program_name'];
}