PHP Classes

lookup error

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  lookup error  
Subject:lookup error
Summary:trouble looking up field in database
Messages:6
Author:Peter P
Date:2009-05-06 19:38:42
Update:2009-05-11 08:39:13
 

  1. lookup error   Reply   Report abuse  
Picture of Peter P 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


There are 5 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.