使用mysql更新数据库中的信息 [英] Update information in database with mysql

查看:110
本文介绍了使用mysql更新数据库中的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,快问。这是我的代码,我不确定它是否是这行或其他代码不起作用。有人可以告诉我它是否正确或修复它,如果不是吗?谢谢!



 $ con = mysqli_connect(localhost,root,root,nz_games); 
$ q1 =UPDATE`register` SET`hs_easy_time` =。 $ timeAtEnd。 WHERE`username` =。 $ user。 ;
mysqli_query($ con,$ q1);





我确定连接有效,register是表名,hs_easy_time是列,username是另一列,$ user和$ timeAtEnd是有效变量。一切的语法是否正确?提前感谢

解决方案

con = mysqli_connect(localhost,root,root,nz_games);


< blockquote> q1 =UPDATE`register` SET`hs_easy_time` =。


timeAtEnd。 WHERE`username` =。


Hi everybody, quick question. This is my code and I'm not sure if it is this line or the rest fot he code that doesn't work. Could someone please tell me if it's right or fix it if it's not? Thanks!

$con = mysqli_connect("localhost","root","root","nz_games");
$q1 = "UPDATE `register` SET `hs_easy_time`=". $timeAtEnd . "WHERE `username`=". $user . "";
mysqli_query($con, $q1);



I'm sure the connection is valid, register is the table name, hs_easy_time is the column, username is another column and $user and $timeAtEnd are valid variables. Is the syntax for everything correct? Thank in advance

解决方案

con = mysqli_connect("localhost","root","root","nz_games");


q1 = "UPDATE `register` SET `hs_easy_time`=".


timeAtEnd . "WHERE `username`=".


这篇关于使用mysql更新数据库中的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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