I've just moved on from using mysql to mysqli extension in PHP.
I've come across two ways of doing the same thing (multiple update queries), what are the pros/cons of each? Should I be using one or the other or something else entirely?
Prepared statement in a loop:
//prepare statement
foreach(whatever){
//execute statement
}
or
Multi-query:
foreach(whatever){
//build many queries into a single string
}
multi_query(long string)
I know that prepared statements offer better security. When using mysql in PHP I've heard its best to avoid using UPDATE statements in a loop - isn't executing a mysqli prepared statement in a loop the same thing by another name?