multiple update using ajax with php

前端 未结 4 1589
醉话见心
醉话见心 2021-01-27 14:53

hey guys im trying to update my database using php ang ajax, but assuming that the textbox are dynamic thats why im trying to update the database using multiple updates with one

相关标签:
4条回答
  • 2021-01-27 15:32

    It appears you have no space between SET and grade.

    Adding a space here should do the trick:

    $update_grades_boys = "UPDATE registrar_grade_archive SET ";
    

    If this doesn't do it, it would help tremendously if you could post the result of echo $ready_edit_grades_boy; and update your question.

    0 讨论(0)
  • 2021-01-27 15:35

    Some problems here:

    • if $student_grades_boy contains more than 1 item, your sql will have multiple WHERE statements (you can only have 1);
    • you need a space between SET and the column name;
    • you have a serious sql injection problem;
    • you should switch to PDO or mysqli as the mysql_ functions are deprecated.
    0 讨论(0)
  • 2021-01-27 15:44

    try

    $update_grades_boys = "UPDATE registrar_grade_archive SET "; 
    

    One space is needed after SET..

    0 讨论(0)
  • 2021-01-27 15:46

    You are not escaping vars, so it could be some ' or " in your values.

    http://php.net/manual/en/mysqli.real-escape-string.php

    0 讨论(0)
提交回复
热议问题