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 usePHP 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());
}
ThanksPHP Code:while($query = "UPDATE " .$table. " SET " .$field. "=" .$value. " WHERE username='$username'";) {
mysql_query($query, $con);
}
Matt



LinkBack URL
About LinkBacks
Reply With Quote


