我有几个需要插入数据库的大表格。
我目前正在这样做
$stmt = $memberMysqli->prepare("INSERT INTO questionnairebespokeexerciseplan(userid,date,naturalbodytype,framesizewrist,framesizeelbow,fitnessgoals,workpattern,sleephours,runningbarriers,workcommute,workdistance,smoke,biomechanicalissues,limitingillness,reletivesheartproblems,birthlast12months,recurringinjuries,regularmedication,pregnant,anythingelsehealth,gymmember,runoutdoors,wouldyouliketorunoutdoors,homeequipments,whattypeequipment,exercisetime,heartratemonitor,restingheartrate,actualheartrate,maxheartrate,heartratesteadyrun,heartratebreathless,trainingshoes,preferredexercisetype,exerciseclasses,classdays,bike,bikemodel,runlunchtimebeforework,clubmember,clubschedule,personaltraining,otherheartrate,foottype) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
$stmt->bind_param('ssssssssssssssssssssssssssssssssssssssssssss',
$_POST['userid'],
$date,
$_POST['naturalbodytype'],
$_POST['framesizewrist'],
$_POST['framesizeelbow'],
$_POST['fitnessgoals'],
$_POST['workpattern'],
$_POST['sleep'],
$_POST['runbarriers'],
$_POST['workcommute'],
$_POST['workmiles'],
$_POST['smoke'],
$_POST['biomechanical'],
$_POST['illnesses'],
$_POST['heartcondition'],
$_POST['givenbirth'],
$_POST['injuries'],
$_POST['medication'],
$_POST['pregnant'],
$_POST['anythingelse'],
$_POST['gymmember'],
$_POST['runoutdoors'],
$_POST['liketorunoutside'],
$_POST['homeequipment'],
$_POST['equipment'],
$_POST['besttime'],
$_POST['heartratemonitor'],
$_POST['restingheartrate'],
$_POST['actualheartrate'],
$_POST['actualmaxheartrate'],
$_POST['heartratesteadyrun'],
$_POST['heartratebreathless'],
$_POST['trainingshoes'],
$_POST['preferredexersize'],
$_POST['classes'],
$_POST['classdays'],
$_POST['bike'],
$_POST['whatbike'],
$_POST['beforeworklunchtime'],
$_POST['clubmember'],
$_POST['clubschedule'],
$_POST['personaltrainer'],
$_POST['otherheartrate'],
$_POST['foottype']
);
我只是在想是否有更好/更快的方法来做到这一点?
目前,创建它需要一些时间,当事情不正确时对其进行调试同样耗时。