Re: [PHP-DB] Not updating certain fields in same row

2008-03-27 Thread Jason Pruim
Hi Everyone Thanks for all the info and help with this, I have decided to write a separate function for changing the password. That way I can compare the original password with the one inputted in the database, and then change it after both have been the old and new password have been

[PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. Basically what I want to do, is say I have these fields: Field1 Field2 Field3 Field4 I update Field1 and Field3 but not Field2 and

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Daniel Brown
On Tue, Mar 25, 2008 at 12:59 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. [snip!] I have tried this code: $tab = \t;

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
On Mar 25, 2008, at 1:09 PM, Daniel Brown wrote: On Tue, Mar 25, 2008 at 12:59 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. [snip!] I

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Matt Anderton
I usually pre-populate the form with the values that are already in the record: (... using PEAR's MDB2 package -- http://pear.php.net/packages/MDB2 ) $query = SELECT * FROM member WHERE username = ' . $_POST['username'] . '; $result = $db-query($query); $member =

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
On Mar 25, 2008, at 1:17 PM, Matt Anderton wrote: I usually pre-populate the form with the values that are already in the record: (... using PEAR's MDB2 package -- http://pear.php.net/packages/MDB2 ) $query = SELECT * FROM member WHERE username = ' . $_POST['username'] . '; $result =

RE: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Miguel Guirao
] Not updating certain fields in same row -- -- -- On Mar 25, 2008, at 1:09 PM, Daniel Brown wrote: -- On Tue, Mar 25, 2008 at 12:59 PM, Jason Pruim [EMAIL PROTECTED] -- wrote: -- Hi everyone, -- -- I am attempting to update a record for a login system while leaving -- certain fields untouched

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Matt Anderton
I encrypt my pw's the same way but I usually don't include the password on an edit my info page. I create a separate change password screen where I force them to type in their old password and then type a new one twice. if the encrypted, salted old password attempt does not match what is in the

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Daniel Brown
On Tue, Mar 25, 2008 at 1:14 PM, Jason Pruim [EMAIL PROTECTED] wrote: the actual query I'm using is this: $chpwsql = UPDATE current SET customerName='$customerName', loginName='$loginName', loginPassword='$PW', email='$email', adminLevel='$adminLevel' WHERE Record='$Record1';

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Evert Lammerts
I might be way off here. Php.net tells me that: [quote] mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement string **mysql_real_escape_string** ( string $unescaped_string [, resource $link_identifier ] ) [/quote] and you use [quote]

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Evert Lammerts
Correction: Also, this condition: [quote] if (!isset($_POST['txtLoginName']) || empty($_POST['txtLoginName'])) [/quote] is true if and only if no form element by the name txtLoginName existed on the previous page - and on top of that, empty() does the same as isset() and apart from that

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
On Mar 25, 2008, at 2:57 PM, Evert Lammerts wrote: I might be way off here. Php.net tells me that: [quote] mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement string **mysql_real_escape_string** ( string $unescaped_string [, resource

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Chris
Jason Pruim wrote: Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. Basically what I want to do, is say I have these fields: Field1 Field2 Field3 Field4 I update Field1 and Field3