php - Update query is not working - need to look -
can tell wrong in query. database in not updating irrespective of value
<?php // ================= update ========================= if ($_post['submit']=='submit') { $fixture_id = "$_get[id]"; $m_date = "$_post[match_date]"; $m_time = "$_post[match_time]"; $m_report = "$_post[match_report]"; $m_a_result = "$_post[team_a_result]"; $m_b_result = "$_post[team_b_result]"; $updt = mysql_query("update `fixture` set match_date='$m_date', match_time='$m_time', match_report='$m_report', match_a_result='$m_a_result', match_b_result='$m_b_result', status = 1 id = '$fixture_id'"); header("location:view_fixture.php?msg= have inserted result successfully..."); } else { header("location:result_update.php?msg= went wrong..."); } // ================================================================================ ?>
before executing make sure submit button have string value of "submit"
try ..
<?php $fixture_id = $_get[id]; if ($_post['submit']=='submit') { $m_date = $_post['match_date']; $m_time = $_post['match_time']; $m_report = $_post['match_report']; $m_a_result = $_post['team_a_result']; $m_b_result = $_post['team_b_result']; $updt = mysql_query("update `fixture` set match_date= '$m_date', match_time='$m_time', match_report='$m_report', match_a_result='$m_a_result', match_b_result='$m_b_result', status = 1 id = '$fixture_id'"); header("location:view_fixture.php?msg= have inserted result successfully..."); } else { header("location:result_update.php?msg= went wrong..."); } ?>
please not use mysql_* . deprecated
Comments
Post a Comment