Page 2 of 2

Posted: Thu Jul 27, 2006 5:22 am
by mohson
Ws just gonna post that I noticed that, soorry!!!!!!!!!!!1 and thanks for the help everyone

Posted: Thu Jul 27, 2006 5:31 am
by JayBird
Why write your SQL like that...just seems to consfuse things more.

something like this i more readable IMO...no need for all that concatenation

Code: Select all

$sql = "UPDATE people 
		SET 
			salutation = '".$salutation."',
			firstname = '".$firstname."',
			surname = '".$surname."',
			organisation = '".$organisation."',
			role = '".$role."',
			address1 = '" .$address1."',
			address2 = '" .$address2."',
			city = '" .$city."',
			telephone = '".$telephone."',
			mobile = '".$mobile."',
			fax = '" .$fax."',
			dateoflastcontact = '".$dateoflastcontact."',
			datecontactagain = '".$datecontactagain."',
			notes = '" .$notes."',
			email = '" .$email."',
        WHERE person_id='".$person_id."'";

Posted: Thu Jul 27, 2006 5:34 am
by Chris Corbyn
I suggest adding "LIMIT 1" for safe measure. In the unlikely event something screws up at least it would only adjust one record this way.

Posted: Thu Jul 27, 2006 5:57 am
by JayBird
d11wtq wrote:I suggest adding "LIMIT 1" for safe measure. In the unlikely event something screws up at least it would only adjust one record this way.
Yeah, good thinking Batman