If class=?

okay so im displaying pages based on what class the item is here is my code


    <?php
$db_host = 'localhost';
$db_user = 'thesocia_oa';
$db_pass = '*********';
$db_database = 'thesocia_oa';
$db_table = 'items';
 
mysql_connect( $db_host, $db_user, $db_pass );
mysql_select_db( $db_database );
$result = mysql_query("SELECT * FROM `items` ORDER BY level ASC") or die(mysql_error());
 $class = mysql_query("SELECT class FROM `items`")
while ($row = mysql_fetch_array($result)) {
	
	if $class == "Bow"; 
?>

Level:<?php echo $row['level']; ?><br />
Name:<?php echo $row['name']; ?>

<br />
<br />
<?php
}
?>

this doesn’t work for some reason? and im not 100% why, could someone help me? class is a field in the table by the way.

Try this:


    <?php
$db_host = 'localhost';
$db_user = 'thesocia_oa';
$db_pass = '*********';
$db_database = 'thesocia_oa';
$db_table = 'items';
 
mysql_connect( $db_host, $db_user, $db_pass );
mysql_select_db( $db_database );
$result = mysql_query("SELECT * FROM `items` ORDER BY level ASC") or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
if ($row['class'] == "Bow") { 
?>

Level:<?php echo $row['level']; ?><br />
Name:<?php echo $row['name']; ?>

<br />
<br />
<?php
}}
?>