Peter P - 2009-05-06 21:25:54
Hi all,
Somewhere in my code i am making a mistake but i cannot figure where. I have a sql statement to return only Courses that there 'type' = executive
Now this query works fine:
"SELECT schools.name,
schools.logo,
schools.schoolurl,
schools.schoolid,
courses.idProvider,
courses.type,
courses.title FROM schools INNER JOIN courses ON schools.schoolid = courses.idProvider WHERE schools.name= %s AND type = 'Executive' ORDER BY title ASC"
However i want to list just the courses and i run the php code from a tab menu:
<?php if ($row_schools['type'] == 'Master') { ?><li><a href="/graduate/<?php echo $row_schools['schoolurl']; ?>"><span>Graduate</span></a></li>
<?php } else { ?>
<li><a href="/showlist/<?php echo $row_schools['schoolurl']; ?>"><span>Graduate</span></a></li> <?php }; ?>
<?php if ($row_schools['type'] == 'Executive') { ?><li><a href="/executive/<?php echo $row_schools['schoolurl']; ?>"><span>Executive Courses</span></a></li>
<?php } else { ?>
<li><a href="/showlist/<?php echo $row_schools['schoolurl']; ?>"><span>Executive Courses</span></a></li> <?php }; ?>
The problem is that it finds and displays the 'Graduate' but not the executive. I have checked with my database that they are registered as Executive and if i run a query from phpadmin it works fine. Any ideas?
All help appreciated.
PP