0 Replies Latest reply on Jul 8, 2010 12:13 AM by chili666

    Only variables can be passed by reference

    chili666

      I am trying to play around with Flash Builder and databases. At the moment I am trying to connect to a local mysq-databse and let flash builder do the hard work and write a sample class for me. Unfortunately it throws an error:

       

      Fatal error: Only variables can be passed by reference in  C:\xampp\htdocs\Flex\bin-debug\services\BuchungsdatenService.php on line  66

       

      It tells me to check if amf.production ist set to false - which is correctly done, as far as I can see.


      Line 66 looks like this:

       

      mysqli_stmt_bind_result($stmt, $row->id, $row->Buchungsnummer, $row->Datum, $row->Soll-Konto, $row->Haben-Konto, $row->Betrag, $row->Buchungstext, $row->Soll_Konto, $row->Haben_Konto);

       

      The whole code for this function:

       

          public function getAllBuchungsdaten() {

       

              $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");       
              $this->throwExceptionOnError();
             
              mysqli_stmt_execute($stmt);
              $this->throwExceptionOnError();
             
              $rows = array();
             
              mysqli_stmt_bind_result($stmt, $row->id, $row->Buchungsnummer, $row->Datum, $row->Soll-Konto, $row->Haben-Konto, $row->Betrag, $row->Buchungstext, $row->Soll_Konto, $row->Haben_Konto);
             
              while (mysqli_stmt_bind_result($stmt)) {
                $rows[] = $row;
                $row = new stdClass();
                mysqli_stmt_bind_result($stmt, $row->id, $row->Buchungsnummer, $row->Datum, $row->Soll-Konto, $row->Haben-Konto, $row->Betrag, $row->Buchungstext, $row->Soll_Konto, $row->Haben_Konto);
              }
             
              mysqli_stmt_free_result($stmt);
              mysqli_close($this->connection);
         
              return $rows;
          }

       

       

      I´ll admit I am quite a noob when it comes to code - but I can´t see anything wrong with that...and it´s just the code that FB has generated. I did not touch it...

       

      So can anyone push please me into the right direction? What is going wrong here?

       

      Thanks in advance...

       

      Chili