我有他们的名称具有结构nameUser.Name的列,但我无法更新它们.我尝试了几种可能性:
原文链接:https://www.f2er.com/php/135675.html// Ideally,I'd like to do this (since the User.Name is 'dynamic',ie,it depends // on who is logged in): $userLogged = 'Some.User'; $columnName = 'name' . $userLogged; MysqL_query("UPDATE Industries SET '$columnName'='$name' WHERE id='$id'"); // Another try: MysqL_query("UPDATE Industries SET $columnName='$name' WHERE id='$id'"); // Alternatively,if the above cannot be achieved: MysqL_query("UPDATE Industries SET 'nameSome.User'='$name' WHERE id='$id'"); // Yet another try: MysqL_query("UPDATE Industries SET nameSome.User='$name' WHERE id='$id'");
但是,不是上述作品.为什么?