why won't my array work?



Hi everyone :) Happy friday to all of you!

Here's my issues, I am attempting to echo the results of mysqli query out to my script just so I can make sure it's working right, what I'm hoping to do in the long run is compare what was typed in a text box to this info... It's for verifying a old password before changing to a new password... So here is my query:

$oldpasswordquery = "SELECT loginPassword, Record FROM current WHERE loginPassword='{$oldPassHash}' AND Record='{$Record}'";
$chpwold[] = mysqli_query($chpwpostlink, $oldpasswordquery) or die("Sorry read failed: ". mysqli_error($chpwpostlink));
$chpwresult = $chpwold[0];
$chpwrow[] = mysqli_fetch_assoc($chpwresult) or die('Sorry it didn\'t work....' .mysqli_error($chpwpostlink));
echo $chpwrow['loginPassword'];
print_r($chpwrow);


The echo and the print_r are for debugging and obviously wont' be in the final script... Here is the error that I am getting:

[Fri Mar 28 12:14:39 2008] [error] PHP Notice: Undefined index: loginPassword in /Volumes/RAIDer/webserver/Documents/dev/OLDBv2/admin/ chpwpost.php on line 18


Line 18 is where the echo is...

the print_r though shows this:

Array ( [0] => Array ( [loginPassword] => 42205baa2581d3fcd8d8f9c6b9746a1f [Record] => 2 ) )

So why can't I access it via $chpwrow['loginPassword']? I'm stumped.... Anyone that can help me has a free beer waiting for them the next time they are in my town! :)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruim@xxxxxxxxxx





Relevant Pages

  • Re: [Full-disclosure] reduction of brute force login attempts via SSHthrough iptables --
    ... Anyhow its no problem at all to modify, so if you dont like it, just dont use it. ... on a lame script like this as long as it WORKS and is not insecure. ... echo "~ sorting out ip by ip" ... # echo "not enough failed logins, probably no attack from: ...
    (Full-Disclosure)
  • Ripping Tapes with Linux--How To
    ... the full script is located in the BASH ... My tape player is a portable style journalist's recorder from the ... The most irritating part of the recording process was setting the ... echo Starting de-noise procedure to file $TMP1 ...
    (comp.os.linux.misc)
  • Re: Linux Backup with Modification Date Filter?
    ... I wrote a bash script that acts as a wrapper to rsnapshot which first ... generates a modification-date filter, ...
    (comp.os.linux.misc)
  • Re: Command Script variable value lost during execution
    ... The value of RC_ver is numeric but ECHO would return it numeric or not... ... I checked ERRORLEVEL at the end of the script and it was 0 but again ... ECHO RoboCopy version xxx%RC_Ver%yyy ... CALL:GetRCVer RoboCopy.exe /Path ...
    (microsoft.public.windows.server.scripting)
  • Re: Bit Twister: Is this the dhclient-exit-hooks you were talking about?
    ... If you are running the dhclient then all you have to do is ... create the hooks script with YOUR CODE. ... DNS server with my wgets and then restart my firewall. ... You can put an echo statement on commands to show you what will happen ...
    (alt.os.linux)