使用bind params进行动态更新查询

I am into situation where i dont know which fields would be set to update , i can get the columns and respected values which need to updated, but how can i get the type of each field for binding parameters using mysqli ?

UPDATE City SET  Name = ?,CountryCode = ?,District = ? WHERE 1

Lets say this is the query i got as for now .. and I would something like this to update ..

$stmt = $conn->stmt_init();
if($stmt->prepare($query)) {
    $stmt->bind_param('sss', $name, $countrycode, $district);
    $stmt->execute();
}

but what if i dont know 'sss' ( in dynamic context ) ?

You can use string for everything. MySQL will convert strings to numbers when necessary. Just as you can do something like:

SET id = '123'

when writing a regular query.