I think Mishu is giving bad advice on this one. Yes, you *CAN* do it the way he says, but it's not optimal. Say you had 100,000 records in your table. And only 7 of them had the active flag equal to 1.
With his solution, MySQL has to send *ALL 100,000 ROWS* to PHP and then PHP simply throws away all but those 7.
The better way is to do this in the SQL query:
$sql = "SELECT * FROM mybb_forms WHERE IFNULL(active,0) = 1";
$data = mysql_query( $sql ) or die( mysql_error() );
... rest of code as you have it...
You don't need to use the IFNULL( )
function if that active
field is *NEVER* null.
Then you could just do
$sql = "SELECT * FROM mybb_forms WHERE active = 1";