- if (count($result) >= 1) {
- echo "<div id='notes'>";
- foreach ($result as $row => $entry) {
- $title = $entry['title'];
- $url = '/note/' . $entry['url'];
- $date_posted = explode("-", $entry['date_posted']);
- $year_posted = $date_posted[0];
- $month_posted = $date_posted[1];
- $datetime_posted = explode(' ', $date_posted[2]);
- $day_posted = $datetime_posted[0];
- echo "<div class='note'>";
- echo "<h1><span class='date'>";
- echo "$year_posted/$month_posted/$day_posted/";
- echo "</span><a href='$url'>$title</a></h1>";
- echo $entry['text'];
- echo "</div>";
- }
- echo "</div>";
- } else {
- echo "<br>";
- echo "<h1>sorry, nothing here</h2>";
- echo "<pre>Empty set (0.00 sec)</pre>";
+ foreach ($result as $row => $entry) {
+ $entry['url'] = '/note/' . $entry['url'];
+ $date_posted = explode("-", $entry['date_posted']);
+ $entry['year_posted'] = $date_posted[0];
+ $entry['month_posted'] = $date_posted[1];
+ $entry['datetime_posted'] = explode(' ', $date_posted[2]);
+ $entry['day_posted'] = $entry['date_posted'][0];
+ $this->notes[$row] = $entry;