MySQLi插入问题但没有错误 [英] MySQLi insert problem but no error

查看:87
本文介绍了MySQLi插入问题但没有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用mysqli向mysql数据库插入一个值,但它没有插入而且没有错误

我的代码

i'm trying to insert a value to mysql database with mysqli but it's not inserting and no error
my code

if ($hwid->num_rows) { 
		if(!mysqli_query($con,"UPDATE $username SET logs = CONCAT(logs,'$logs') WHERE hwid = '$id'")){
    			die(mysqli_error($con));
				exit;}
  } 
   else{
	   if(!mysqli_query($con,"INSERT INTO $username (hwid, date, logs) VALUES ('$hwid', '$date', '$logs')")){
    			die(mysqli_error($con));
				exit;}
   }





我没有错误,也没有插入数据。我确定第一个$ hwid查询正确执行

有什么问题



I gives no error and not inserts data. I'm sure first $hwid query executing properly
What is the problem

推荐答案

hwid-> num_rows){
if(!mysqli_query(
hwid->num_rows) { if(!mysqli_query(


con, UPDATE
con,"UPDATE


用户名SET logs = CONCAT(logs,'
username SET logs = CONCAT(logs,'


这篇关于MySQLi插入问题但没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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