cyrixware Posted April 12, 2008 Share Posted April 12, 2008 The problem is that when i click the submit button the page turns blank... maybe thers something wrong in this line $sql_update = "UPDATE studsubj SET SCourse = '$SuCourse', SCode ='$SCode', SuID = '$SuID', SuGrade = '$ave' WHERE SCode = '$SCode' AND SuID = '$SuID'"; Because when i erased this one: WHERE SuID = '$SuID'"; from WHERE SCode = '$SCode' AND SuID = '$SuID'"; it works fine. but the problem is i need to bind or use the SuID and SuCourse togethere... <?php $sql_update = "UPDATE studsubj SET SCourse = '$SuCourse', SCode ='$SCode', SuID = '$SuID', SuGrade = '$ave' WHERE SCode = '$SCode' AND SuID = '$SuID'"; if(!$q_update = mysql_query($sql_update)) { die(mysql_error()); } elseif(mysql_affected_rows() == 0) { die(mysql_error()); } else { ?> <script language="JavaScript"> alert("Correct Answers = <?=$CorrectAns;?> out of <?=$tItems;?> Average = <?=$ave;?>%."); win = window.open('topicareaStudent.php?ID=<?=$session_id;?>&SuID=<?=$SuID;?>&SuCourse=<?=$SuCourse;?>','_self'); </script> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/100801-solved-whats-wrong-in-my-codes/ Share on other sites More sharing options...
AndyB Posted April 12, 2008 Share Posted April 12, 2008 What happening that you don't want? What's not happening that you do want? The <?= shorthand is a deprecated practice. Perhaps your php version doesn't support it. Tell us more ... Link to comment https://forums.phpfreaks.com/topic/100801-solved-whats-wrong-in-my-codes/#findComment-515509 Share on other sites More sharing options...
cyrixware Posted April 12, 2008 Author Share Posted April 12, 2008 The problem is that when i hit the submit button after this codes the page goes blank. Link to comment https://forums.phpfreaks.com/topic/100801-solved-whats-wrong-in-my-codes/#findComment-515512 Share on other sites More sharing options...
cyrixware Posted April 12, 2008 Author Share Posted April 12, 2008 <?php $sql_update = "UPDATE studsubj SET SCourse = '$SuCourse', SCode ='$SCode', SuID = '$SuID', SuGrade = '$ave' WHERE SCode = '$SCode' AND SuID = '$SuID'"; $q_update= mysql_query($sql_update); mysql_error(); ?> Got it i change my query like this one... hehehe Link to comment https://forums.phpfreaks.com/topic/100801-solved-whats-wrong-in-my-codes/#findComment-515520 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.