Explode not working with these form posts to jQuery

时间:2015-11-12 11:05:31

标签: php jquery html explode

I am trying to create an admin function where the admin can modify the user's information. In the form, there are id number, username, password, and level. What I want to do here is when the admin clicks and modifies a certain information, the PHP query(through jQuery modal script) will update the information.

Here is my HTML code

            <tr class="<?php if($i%2 == 0) { echo 'even'; } else { echo 'odd'; } ?>">

            <td><div class="grid_content editable"><span><?php echo $records['id_number']; ?></span><input type="text" class="gridder_input" name="<?php echo encrypt("idnum|".$records['id_number']); ?>" value="<?php echo $records['id_number']; ?>" /></div></td>
            <td><div class="grid_content editable"><span><?php echo $records['username']; ?></span><input type="text" class="gridder_input" name="<?php echo encrypt("un|".$records['id_number']); ?>" value="<?php echo $records['username']; ?>" /></div></td>
            <td><div class="grid_content editable"><span><?php echo $records['password']; ?></span><input type="text" class="gridder_input" name="<?php echo encrypt("pwd|".$records['id_number']); ?>" value="<?php echo $records['password']; ?>" /></div></td>
            <td><div class="grid_content editable"><span><?php echo $records['level']; ?></span>
            <select class="gridder_input select" name="<?php echo encrypt("level|".$records['id_number']); ?>">
                <?php foreach($department as $departments) { ?>
                <option value="<?php echo $departments; ?>" <?php if($departments == $records['level']) { echo 'selected="selected"'; } ?>><?php echo $departments; ?></option>
                <?php } ?>
            </select>
            </div></td>
            <td>
            <a href="gridder_addnew" id="gridder_addnew" class="gridder_addnew"><img src="img/insert.png" alt="Add New" title="Add New" /></a>
            <a href="<?php echo encrypt($records['id_number']); ?>" class="gridder_delete"><img src="img/delete.png" alt="Delete" title="Delete" /></a></td>
        </tr>

Here is my PHP code

$value  = $_POST['value'];
    $crypto = decrypt($_POST['crypto']);
    $explode = explode('|', $crypto);
    $columnName = $explode[0];
    $rowId = $explode[1];
    $query = mssql_query("UPDATE management SET  $columnName = '$value' WHERE id_number = '$rowId' ");

PHP code does not work. It does not update any information. What may be the problem here?

0 个答案:

没有答案