使用内部联接更新查询结果中的行

时间:2019-05-22 11:44:54

标签: php mysql dynamic

我已经尝试了建议的类似帖子中的所有解决方案,但没有一个适合我。我尝试过在查询中更新多个表,并且更新表单显示在循环中(查询结果),但对我来说根本不起作用!以下是我的代码,有人可以告诉我它有什么问题吗?预先感谢

UPDATE assessFluency f 
  JOIN assessAccuracy ac 
    ON f.assessStudentFluency = ac.assessstudentAccuracy 
  JOIN assessIndependentLevel ai 
    ON f.assessStudentFluency = ai.assessStudent 
  JOIN assessInstructionalLevel inst 
    ON f.assessStudentFluency = inst.assessStudentInstruct 
  JOIN assessComprehension acm 
    ON f.assessStudentFluency = acm.assessStudentComprehension 
  JOIN assessSelfCorrection sc 
    ON f.assessStudentFluency = sc.assessStudentSelfCorrection 
  JOIN assessWordsPerMinute wp 
    ON f.assessStudentFluency = wp.assessStudentWordsPerMinute 
   SET f.assessFluency                   = $assessFluency
     , f.assessFluencyDate               = $assessFluencyDate
     , ac.assessAccuracy                 = $accuracyAssess
     , ac.assessAccuracyDate             = $assessDate
     , ai.assessIndependentLevel         = $independentAssess
     , ai.assessIndependentLevelDate     = $indAssessDate
     , inst.assessInstructionalLevel     = $instructAssess
     , inst.assessInstructionalLevelDate = $instructDate
     , acm.assessComprehension           = $comprehensionAssess
     , acm.assessComprehensionDate       = $comprehensionDate
     , sc.assessSelfCorrection           = $assessSelfCorrection
     , sc.assessSelfCorrectionDate       = $assessSelfCorrectionDate
     , wp.assessWordsPerMinute           = $assessWordsPerMinute
     , wp.assessWordsPerMinuteDate       = $assessWordsPerMinuteDate
 WHERE f.assessFluencyID         = '".$fluencyID."' 
    OR ac.assessAccuracyID       = '".$accuracyID."' 
    OR ai.assessIndepenID        = '".$IndepenID."'
    OR inst.assessInstructID     = '".$InstructID."'
    OR acm.assessComprehensionID = '".$comprehensionID."'
    OR sc.assessSelfCorrectionID = '".$selfCorrectionID."'
    OR wp.assesswordsPerMinuteID = '".$wordsminuteID."'

This is a screen shot of the user's view

0 个答案:

没有答案