Where are my values?!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sanders Kaufman

    Where are my values?!

    No - this isn't a morality question. :)

    When I run this:
    foreach ($this->RecordSet[0] as $x=>$y){
    echo "<br>$x = $y";
    }

    I get this:
    username = alpha
    password = omega

    But when I run this:
    echo $this->Recordset[0]["username"]
    echo $this->Recordset[0]["password"]

    I don't get squat.


    I know it's something symple with the sintax - but I just ain't seeing it.

    What am I doing wrong?!
  • Michael Fesser

    #2
    Re: Where are my values?!

    ..oO(Sanders Kaufman)
    >No - this isn't a morality question. :)
    There's not even a constructor ... SCNR ;)
    >When I run this:
    > foreach ($this->RecordSet[0] as $x=>$y){
    > echo "<br>$x = $y";
    > }
    >
    >I get this:
    > username = alpha
    > password = omega
    >
    >But when I run this:
    > echo $this->Recordset[0]["username"]
    > echo $this->Recordset[0]["password"]
    >
    >I don't get squat.
    >
    >
    >I know it's something symple with the sintax - but I just ain't seeing it.
    Do you have error_reporting set to E_ALL? PHP should give you a notice.

    $this->RecordSet
    $this->Recordset

    See the difference?

    Micha

    Comment

    • Chris Hope

      #3
      Re: Where are my values?!

      Sanders Kaufman wrote:
      No - this isn't a morality question. :)
      >
      When I run this:
      foreach ($this->RecordSet[0] as $x=>$y){
      echo "<br>$x = $y";
      }
      >
      I get this:
      username = alpha
      password = omega
      >
      But when I run this:
      echo $this->Recordset[0]["username"]
      echo $this->Recordset[0]["password"]
      >
      I don't get squat.
      >
      >
      I know it's something symple with the sintax - but I just ain't seeing
      it.
      >
      What am I doing wrong?!
      Case sensitivity.

      $this->RecordSet[0]

      is not the same as

      $this->Recordset[0]

      --
      Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com

      Comment

      • Sanders Kaufman

        #4
        Re: Where are my values?!

        Michael Fesser wrote:
        .oO(Sanders Kaufman)
        >
        >No - this isn't a morality question. :)
        >
        There's not even a constructor ... SCNR ;)
        >
        >When I run this:
        > foreach ($this->RecordSet[0] as $x=>$y){
        > echo "<br>$x = $y";
        > }
        >>
        >I get this:
        > username = alpha
        > password = omega
        >>
        >But when I run this:
        > echo $this->Recordset[0]["username"]
        > echo $this->Recordset[0]["password"]
        >>
        >I don't get squat.
        >>
        >>
        >I know it's something symple with the sintax - but I just ain't seeing it.
        >
        Do you have error_reporting set to E_ALL? PHP should give you a notice.
        >
        $this->RecordSet
        $this->Recordset
        >
        See the difference?
        Oh, for crying out loud!
        I knew it was something stupid.
        Thanks.

        Comment

        • Toby A Inkster

          #5
          Re: Where are my values?!

          Sanders Kaufman wrote:
          But when I run this:
          echo $this->Recordset[0]["username"]
          echo $this->Recordset[0]["password"]
          >
          I don't get squat.
          Are you sure the keys are exactly right? Sure it's not something like...

          $this->Recordset[0]["username "]

          ??

          --
          Toby A Inkster BSc (Hons) ARCS
          [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
          [OS: Linux 2.6.12-12mdksmp, up 35 days, 1:40.]

          Cryptography Challenge

          Comment

          Working...