如何在php中更新字符串主题代码 [英] How do I update the string subject code in php

查看:64
本文介绍了如何在php中更新字符串主题代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的逻辑错误是每当我编辑主题代码时都没有发生。



这里是我的代码:



The logical error here is every time I edit the subject code nothing happens.

here's my code:

if(isset($_POST['update'])){

    $sub_code=$_POST['sub_code_txt'];
    $semester=$_POST['semestertxt'];
    $subject_name=$_POST['subtxt'];
    $units=$_POST['units_txt'];
    $note=$_POST['notetxt'];

    $sql_update=mysql_query("UPDATE subjects SET

                            sub_code='$sub_code',//this is the problem, cannot be updated
                            semester='$semester',
                            subject_name='$subject_name',
                            units='$units',
                            note='$note'

                        WHERE sub_code='$sub_code'
                    ");

<tr>
     <td>Subject Code</td>
        <td>
            <input type="text" name="sub_code_txt" id="textbox" value="<?php echo $rs_upd['sub_code'];?>"  />
         </td>
</tr>

推荐答案

_POST [' update'])){
_POST['update'])){


sub_code =
sub_code=


_POST [' sub_code_txt'];
_POST['sub_code_txt'];


这篇关于如何在php中更新字符串主题代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆