Help with... Get options from database (advanced)

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 19, 2011   (RSS)

Re: [zip222] Help with... Get options from database (advanced)

By robin - April 19, 2011

Hey,

I've fixed up your syntax a bit, hopefully that should work for you now.

Robin

<?php
if ($CURRENT_USER['user_type']!="section") {
$where="";
}
else {
$where="WHERE num='".$CURRENT_USER['related_section']."'";
}
?>
SELECT num, title
FROM <?php echo $TABLE_PREFIX ?>sections
<?php echo $where ?>
ORDER BY title ASC

Robin
Programmer
interactivetools.com

Re: [robin] Help with... Get options from database (advanced)

By zip222 - April 19, 2011

Perfect. Thanks!