$query = "SELECT * FROM `makes` WHERE id='" . $row['makeID'] . "'"; $sql = mysql_query($query); while($tmp = mysql_fetch_row($sql)) { $make = $tmp['make']; } function getresult($query) { $result=mysql_query($query); if ($result==true) { { while ($get=@mysql_fetch_array($result)) return $get; } }