View Single Post
  #1  
Old 05-04-2008, 05:54 AM
Phouber Phouber is offline
Corporal
 
Join Date: May 2008
Posts: 10
Default Updating multiple fields

Hey guys,
I have a code here that works fine, the problem is i want to update more than 1 field.
PHP Code:
function updateField($username$table$field$value) {
 
con=connect(); //My connection function
 
$query "UPDATE " .$table" SET " .$field"=" .$value" WHERE username='$username'";
 
$result mysql_query($query$con) or die(mysql_error());

Am I allowed to use an array or do I have to use
PHP Code:
while($query "UPDATE " .$table" SET " .$field"=" .$value" WHERE username='$username'";) {
 
mysql_query($query$con);

Thanks
Matt
Reply With Quote