hello all. I have had some problems with some code i have been working on! I cant seem to get the SQL update to work for this particular script!
i have tried everything i can think of, even parts of script found here in this site by others.
im new to perl so any help would be great.
thanks
NOTE: html tags have been removed.
$db->Sql ("SELECT * FROM Staff");
$hit=0;
while ($db->FetchRow())
{
my(%record) = $db->DataHash();
if ($FORM{'name'} eq $record{'login'} && $FORM {'password'} eq $r
+ecord{'password'})
{
$hit=1;
if ($FORM{'newpassword'} eq $FORM{'confirmpassword'})
{
-------------------------------
PROBLEM
#$sql = qq{INSERT INTO Dreamcpu(FirstName, LastName, Address, Email, P
+h +one, Username, Password) VALUES ('$first', '$last', '$adress', '$e
+mai +l','$phone', '$user', '$pass');};
#$sqlupdate = qq {UPDATE staff SET password=$FORM WHERE $FORM{'user'}
+LIKE $record{'login'}";
my $query = "UPDATE staff SET password=$FORM{'newpassword'} WHERE $FOR
+M={'name'} eq $record{'login'}";
#$dbh->do (qq{ UPDATE `staff` SET `password` = $FORM{'newpassword'}})"
+;
$dbh->do(sqlupdate);
$db->close();
----------------------------
#OK PASSWORD CHANGED
}
else
{
#Please Use Your Browsers Back Button To Re-Enter
$db->Close();
}
}
}
if ($hit ne 1)
{
#logs error logouts.
#COULD NOT FIND LOGIN NAME!;
Please Use Your Browsers Back Button & Re-Enter;
}
#close the connection to the database end the html page.
$db->Close();
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.