Simple question about IF statement

lexou7

New Member
I just wonder how to check if there is a value in a column in a database table? The column is named \[code\]star\[/code\] and I want to check if it has a value of 1 if not don't do anything. \[code\]while($row01 = $res01->fetch_object()) { if ($res01->star[$row01] == 1) { ?????????? }}\[/code\]I use thise WHILE LOOP to fetch info from a table about some objects. For some objects I have a column named STAR that is 1 och NULL. While I build up the HTML-code into variables I in this loop, I also check if the object has 1 in the STAR column and if yes I create another variable with some HTML-code to use in the list of all the objects in the table.But when I use if($row01->star == '1') it's not working and I don't know why!? When I use this it's like, yes all objects has 1, but there is only a few that has 1, the rest has NULL value. Sorry, but I have to leave the computer for some houres, but I hope to solve this later today! Thanks!
 
Top