Please help me to understand how to optimize mysql queries in php. When you have a lot of columns, prepared statement looks like
$inst = $db->prepare("insert into year_$year (user_name,type_of_day,month_row,day_1,day_2,day_3,day_4,day_5,day_6,day_7,day_8,day_9,
day_10,day_11,day_12,day_13,day_14,day_15,day_16,day_17,day_18,day_19,day_20,day_21,day_22,day_23,day_24,day_25,day_26,day_27,day_28,day_29,day_30,day_31)
values
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
$inst->execute($chunk_post[$init]);
this code is from here: http://govnokod.ru/php?page=356 where people ridicule shitty codes.
I do not understand how to do it in other way.