I have a script that count and print every week in a selected year. Now i want to connect this to the returned result from a MySQL query. Code to explain what I am trying to accomplish: // $number_weeks = weeks in chosen year for($i = 1;$i <= $number_weeks;$i++) { $row = mysql_fetch_array($result); if ($row['week'] == $i) { echo "Exsisting in database!"; } }