$i = 1; while ($this->row = $this->fetch_assoc($this->result)) { $this->replace = array($yoursiteurl, $this->row['id'], $this->row['title'], $this->row['description'], $this->row['url'], $this->row['thumbnail'], $this->row['category'], $this->row['hits'], $this->row['submittedby'], $this->row['time']); $this->output .= str_replace($this->find, $this->replace, $this->format); if ($i % 2 == 0) { $this->output .= '
'; } $i++; }