
应该是
update table set field=concat_ws(' ', field, '072110003') where field='072110001'
或者
update table set field=concat(field, ' ', '072110003') where field='072110001'
对于需要一次添加多个值,并且都用' '隔开的话,用第二条语句比较方便。 一次只用一个的话,concat比较简单而且不同数据库通用。
//上面要有连接数据源的内容$link$dpassword=$_POST[dpassword]
$sql="select * from test where dpassword='$dpassword'"
$result=mysql_query($sql,$link)
$row=mysql_num_rows($result)
if($row <1){
echo "密码错误"
}else{
$sql="delete from test where dpassword='$dpassword'"
mysql_query($sql,$link)
echo "删除成功"
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)