Not updating certain fields in same row

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 Field4. What I want to do is change the values in Field1 and Field3 without touching the values in Field2 and Field4.

I have tried this code:
		$tab = "\t";
	if (!isset($_POST['txtLoginName']) || empty($_POST['txtLoginName'])) {
		
$loginName = mysqli_real_escape_string($chpwpostlink, $_POST['txtLoginName']);
		}
		else
		{
			$loginName = $tab;
		}

which works the fields that I've changed, but if I don't submit a value in the form it sets the field to be blank in MySQL. Which is what I am trying to avoid. Any ideas?

--

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




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux