| Author |
Where are my values?!
|
|
| Sanders Kaufman 2007-07-25, 7:00 pm |
| 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 2007-07-25, 7:00 pm |
| ..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
| |
| Chris Hope 2007-07-25, 7:00 pm |
| 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
| |
| Sanders Kaufman 2007-07-25, 7:00 pm |
| Michael Fesser wrote:
> .oO(Sanders Kaufman)
>
>
> There's not even a constructor ... SCNR ;)
>
>
> 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.
| |
| Toby A Inkster 2007-07-25, 7:00 pm |
| 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
[G of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 35 days, 1:40.]
Cryptography Challenge
http://tobyinkster.co.uk/blog/2007/...ypto-challenge/
|
|
|
|