while und eine Variable

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • while und eine Variable

    Hallo!


    PHP-Code:
    function getlist ($queryString$template1$template2$template3)
        {
        
    $result = @mysql_query($queryString);
        
    $this->result $result;    
        
    $this->template1 $template1;
        
    $this->template2 $template2;
        
    $this->template3 $template3;
        
    if (
    $this->result) {


        while (
    $row mysql_fetch_array($this->resultMYSQL_ASSOC)) {
        
    $tblID $row["ID"];
        
    $tbldir $row["directory"];
        
    $tbllink $row["linkname"];
        
    $tblarea $row["area"];
        
    $tblareaname $row["areaname"];
        

    $this->content $this->template1 $tbllink $this->template2 $tbldir $this->template3;

    }
    }
        
        } 

    Hier wird leider logischerweise nur die letzte Zeile in die Variable $content übergeben. Möchte aber die gesamte Liste in eine Variable stopfen. Gibt es eine andere Lösung ausser eine Session ?


    danke euch

  • #2
    PHP-Code:
    $this->content[] 
    ?

    gruß
    peter
    Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
    Meine Seite

    Kommentar


    • #3
      Ok ich habe nun:

      PHP-Code:
      $this->content[] = $this->template1 $tbllink $this->template2 $tbldir $this->template3;
      return 
      $this->content
      Aber wie bekomme ich es raus ? mit folgendem geht es nicht:

      PHP-Code:
          $PhpGallery= new PhpGallery();
          
      $PhpGallery->pconnect($host$database$user$password);
          
      $PhpGallery->getlist(AREA1TEMPLATE1TEMPLATE2TEMPLATE3);
          
      $content "<span class='menuDark'>" $PhpGallery->content "</span>"

      Kommentar


      • #4
        Hi,

        vll so
        PHP-Code:
        join(' ',$PhpGallery->content); 

        ps:
        pconnect ist böse
        (((call/cc call/cc) (lambda (x) x)) "Scheme just rocks! and Ruby is magic!")

        Kommentar


        • #5
          Wieso ist pconnect böse?


          Habe schon in so vielen büchern gelesen das pconnect einfach das ganze schneller macht.
          mit einem einfachen connect ist immer diese ewige start zeit ....

          Kommentar


          • #6
            Hi,

            das hier beschreibts ganz gut
            Normally you do NOT want to use mysql_pconnect. This function is designed for environments which have a high overhead to connecting to the database. In a typical MySQL / Apache / PHP environment, Apache will create many child processes which lie in idle waiting for a web request to be assigned to them. Each of these child processes will open and hold its own MySQL connection. So if you have a MySQL server which has a limit of 50 connections, but Apache keeps more than 50 child processes running, each of these child processes can hold a connection to your MySQL server, even while they are idle (idle httpd child processes don't lend their MySQL connection to other httpd children, they hold their own). So even if you only have a few pages which actually connect to MySQL on a busy site, you can run out of connections, with all of them not actually being used.
            greets
            (((call/cc call/cc) (lambda (x) x)) "Scheme just rocks! and Ruby is magic!")

            Kommentar


            • #7
              Vielen dank das Problem ist gelöst! genial

              Kommentar

              Lädt...
              X