Hey guys,
I have a code here that works fine, the problem is i want to update more than 1 field.
Am I allowed to use an array or do I have to use
Thanks
Matt
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());
}
PHP Code:
while($query = "UPDATE " .$table. " SET " .$field. "=" .$value. " WHERE username='$username'";) {
mysql_query($query, $con);
}
Matt
Comment