Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this a valid statment? 1

Status
Not open for further replies.

overyde

Programmer
May 27, 2003
226
ZA
Hi,
I'm creating a php form which updates the database when the user fills out the form. Concerning the update command, is this a valid statement.

$sql = "UPDATE place SET address = '$_POST[address]', SET f_name = '$_POST[f_name]', SET l_name = '$_POST[l_name]' where specials= '$_SESSION[idno]'";
 
So how would I modify specified fields in one statement other than:

$sql = "UPDATE place SET field1 = 'value1', SET field2= 'value2', SET field3 = 'value3' where idfield= 'idvalue'";
 
$sql = "UPDATE place SET field1 = 'value1', field2= 'value2',field3 = 'value3' where idfield= 'idvalue' (or idfield= idvalue depending on which type ur id is)";



--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top