irgendwie habe ich hier nen problem mit der letzen while schleife ( scheint endlos zu laufen)
die obere funktion erzeugt mir ohne probleme mein array wie ich es will
	
							
						
					die obere funktion erzeugt mir ohne probleme mein array wie ich es will
PHP-Code:
	
	
<?php
        function get_2dim() {
            //global vars
            global $tpl;            //smarty
            global $objDB;            //pear
            global $PHP_SELF;
            global $QUERY_STRING;
            
        $sql=  "SELECT
                    P.name as pname, P.pid, P.date, P.spid,
                    C.name as cname
                FROM 
                    ".PREFIX."client C
                    LEFT JOIN ".PREFIX."projekt P 
                        ON P.cid = C.cid
                WHERE
                    P.status = 0";
        $result = $objDB->query($sql);    
        if(DB::isError($result)) {        
            die($result->getMessage());    
        }
        while($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {  
            $qwe[$row['cname']][] = $row;        
            $cname[] =$row['cname'];
        }
        foreach ($qwe as $client) {
            foreach ($client as $projekt) {
                $this->cpdata[$projekt['cname']]['projekte'][] = array($projekt['pname'],$projekt['pid']);
            }
        }
        vd($this->cpdata);
        $this->do_js();
    }
#############################################
    function do_js() {
        //global vars
        global $tpl;            //smarty
        global $objDB;            //pear
        global $PHP_SELF;
        global $QUERY_STRING;
        //JS für Projkte erzeugen
            //newCat();
            //O("3-D Animation","/3d/");
            //O("Design","/dlab/");
            //O("DHTML","/dhtml/");
            //O("E-Commerce","/ecommerce/mm/");
            //O("Graphics","/graphics/");
            //O("HTML","/html/");
            //O("JavaScript","/js/")
        $js = "";
        while($data = $this->cpdata){
            //neuer punkt
            if( $check) {
                $js.= "newCat(); \n";
            }
            $js .= "O(\"".$data['projekte']['pname']."\",\"".$data['projekte']['pid']."\")";
            $js .= "\n";
            //new cat wurde erstellt
            $check = false;
        }
        //vd($js);
        $tpl->assign('head', $js);
    }
?>
 
          


Kommentar