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!
<?php
$css_append = '';
$system = mysql_query("select * from mos_content") or die(mysql_error());
while ($donnee = mysql_fetch_array($system))
{
if ( 18 == $donnee['sectionid'] )
{
$css_append = 'ps3';
}
echo '<tr><td class="contentheading' . $css_append . $params->get('pageclass_sfx') . '" width="90%" >In the cell</td></tr>';
}
?>
This is very similar to what i am doing, its just doing it a different way. Basically if sectionid=18 then class=contentheadingps3
So i tried this code just there and without the In the Cell bit. Let me say first the css is used to display an image next to title of article and also controls title text color etc. Ok so i take it this uses a loop? Because it ends up showing the small blue squares hundreds of times and then next to those on the same row it shows red ones as well for each article title. I just want it to see if the article is sectionid=18 then use class=contentheadingps3. Is there somethin 'wrong' in the code
Here is the latest piece of code. I echoed out $sectionid and it gives me the number of 924(maybe its the the number of articles there are in total in mos_content table ) and it shows it for every article. Why is this? This is what the problem must be then. I dont know why it thinks the sectionid of the article is 924 Now i have kind of found the problem and have no idea how to solve this. Any idea's?