insert array to mysql db function
- by ganjan
Hi. I have an array where the keys represent each column in my database. Now I want a function that makes a mysql update query. Something like
$db['money'] = $money_input + $money_db;
$db['location'] = $location
$query = 'UPDATE tbl_user SET ';
for($x = 0; $x < count($db); $x++ ){
$query .= $db something ".=." $db something
}
$query .= "WHERE username=".$username." ";