After mysql_query, no result output

Posted by Jerry on Stack Overflow See other posts from Stack Overflow or by Jerry
Published on 2010-05-27T19:06:52Z Indexed on 2010/05/27 19:11 UTC
Read the original article Hit count: 142

Filed under:
|
|
|

I have a simple mysql_query() update command to update mysql.

When a user submits my form, it will jump to an update page to update the data. The problem is that there's supposed to be some data shown after the update, but it comes out blank.

My form

<form id="form1" method="POST" action="scheduleUpdate.php" >

  <select name=std1>
    <option>AA</option>
    <option>BB</option>
    <option>CC</option>
  </select>

  <select name=std2>
    <option>DD</option>
    <option>EE</option>
    <option>FF</option>
  </select>

.......//more drop down menu but the name is std3..std4..etc...
.......
</form>

scheduleUpdate.php

//$i is the value posted from my main app to tell me how many std we have

for($k=0;$k<$i;$k++){

    $std=$_POST['std'.$k];
//if i remove the updateQuery, the html will output.I know the query is the problem but i //couldn't fix it..
    $updateQuery=mysql_query("UPDATE board SET
                student='$std'
                WHERE badStudent='$std' or goodStudent='$std'",$connection);
        //no output below this line at all
        if($updateQuery){
        DIE('mysql Error:'+mysql_error());
        }

    }

// I have bunch of HTML here....but no output at all!!!!

MySQL will be updated after I hit submit, but it doesn't shown any HTML.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql