All pastes #1540112 Raw Edit

Jemand

public php v1 · immutable
#1540112 ·published 2009-08-23 10:56 UTC
rendered paste body
<?php    $this->amok->sql->query('SELECT id, author, topic, text, datum, uhrzeit FROM notes WHERE sichtbar=1 ORDER BY id DESC', SQL_ALL, SQL_ASSOC);    $data = $this->amok->sql->record;        $this->amok->sql->query('SELECT notes.id, tags.name FROM notes    													LEFT JOIN notes_has_tags    														ON notes.id = notes_has_tags.note     													JOIN tags    														ON  notes_has_tags.tag = tags.id    													ORDER BY tags.name ASC', SQL_ALL, SQL_ASSOC);    $tags = $this->amok->sql->record;        //den Einträgen die zugeordneten Tags in Form eines Arrays hinzufügen        for ($i=0; $i<count($tags); $i++)    {    	for ($j=0; $j<count($data); $j++)    	{	    	if ($tags[$i]['id'] == $data[$j]['id'])	    	{	    		$data[$j]['tags'][] = $tags[$i]['name'];	    	}    	}    }?>