简体   繁体   English

PHP MySQL更新放在空白处

[英]Php mysql update puts in blank space

Okay, so i have a problem here. 好吧,所以我在这里有问题。 I solved the updating to a mysql database with just set values. 我解决了仅通过设置值更新到mysql数据库的问题。 But now i want to let the user put something by use of a textbox to update a row. 但是现在我想让用户通过使用文本框来添加内容以更新行。 this doesnt seem to work 这似乎不起作用

code: 码:

$newfirstname = $_POST['newfirstname'];

        //Update the record
        $updateQuery = "UPDATE users SET firstname = '".$newfirstname."' WHERE KcID = 2";
        mysql_query($updateQuery) or die("Error: ".mysql_error());
        //create the query
        $query = mysql_query("select * from voskousers");

        //return the array and loop through each row
        while ($row = mysql_fetch_array($query))
        {
    ?>

It just doesnt update it with the right value, it makes it a blank space in my row. 它只是不使用正确的值来更新它,因此在我的行中使其成为空白。

是因为您要更新一个名为users的表,然后从一个名为voskousers的表中进行选择吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM