Re: Changing data in a table

From: Date: Sat, 18 Nov 2000 06:39:51 +0000
Subject: Re: Changing data in a table
Groups: php.general 
Request: Send a blank email to php-general+get-26027@lists.php.net to get a copy of this message
Addressed to: jeof@jeof.net php-general@lists.php.net ** Reply to note from Jeof Oyster <jeof@jeof.net> Sat, 18 Nov 2000 00:26:31 -0500 > > Thanks for the help from "selecting a specific record from..." > > Got another question. Using PHP, how do you change the information that > is in a specific record in a table. Basically, we need to change the data > for a field for a specific record (a username) from No to Yes or Yes to > No. How do you actually change the data that already exists? > Something like this? $query = "UPDATE TableName SET " . " field1 = '$value1', " . " field2 = '$value2', " . "WHERE keyfield = '$keyvalue' "; Feed that string to mysql_query(), and your table will be updated. There is no return value for this like there is with a SELECT query. Rick Widmer Internet Marketing Specialists www.developersdesk.com

« previous php.general (#26027) next »