草庐IT

mysqli_affected_rows

全部标签

php - mysqli_query() 警告参数 1 为 mysqli,给定为空。数据库查询失败

我收到这个警告:(!)Warning:mysqli_query()expectsparameter1tobemysqli,nullgiveninC:\wamp\www\inc\functions.phponline73CallStack#TimeMemoryFunctionLocation10.0003251048{main}()..\manage_user.php:020.0012295000find_all_users()..\manage_user.php:830.0012295376mysqli_query()..\functions.php:73Databasequeryfa

php - mysqli_fetch_assoc 在第一行死了

我在MySQL中有下表:╔══════╦════╗║...城市.....║...zip..║╠══════╬════╣║布拉格。║11000║║bool诺.....║34785║╚═══════════╝以下代码有效:ClassMysql{functionconnect(){$this->c=newmysqli($this->OPTION['dbhost'],$this->OPTION['dbuser'],$this->OPTION['dbpass'],$this->OPTION['dbname']);if($this->c->connect_errno){exit("Connectf

PHP/SQLite3 : Fatal error: Call to undefined function sqlite_num_rows()

当我调用函数sqlite_num_rows时出现此错误。它一定不是依赖性问题,因为其他Sqlite函数正在运行。我能够打开连接并从数据库获取数据。 最佳答案 晚了4年,但我遇到了同样的问题,所以这是我为遇到同样问题的任何人提供的解决方案//$dbisthedatabasehandle$result=$db->query("SELECT*FROMtable_name");$rows=0;//setrowcounterto0while($row=$result->fetchArray()){$rows+=1;//+1tothecount

php - SQL 错误 : SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

我在使用PHP和SQL时遇到一些问题,PHP对我来说是新手,而且我缺乏SQL。我想在我的数据库表中添加值:值要么取自一个表单,要么取自另一个表(如FK)。这是数据库:createdatabaseAAA;useAAA;createtableassure(id_assurevarchar(13)notnull,nomvarchar(20),adressevarchar(50),mdpvarchar(60),primarykey(id_assure));createtablevehicule(id_vehiculevarchar(13)notnull,immatriculationvarch

php - 如何在考虑事务的情况下使用prepare语句向MySQLi中的三个不同表插入数据

什么是同时执行以下SQL语句的完美和最安全的方式,考虑到MySQLi中的事务,以便将数据添加到所有表中,或者当添加过程发生故障时需要回滚数据一个在table上。$conn=newmysqli(DBHOST,DBUSER,DBPASS,DBNAME);$stmt1=$conn->prepare("INSERTINTOstdHouseholder(usersID,parentJob,phoneNumber,address)VALUES(?,?,?,?)");$stmt1->bind_param("ssss",$userId,$parentJob,$phoneB,$addressB);$st

php - 查询在使用 mysqli 的 php 中无法正常工作

**DELETE.php**这是我的delete.php文件删除查询工作正常。但是两个更新查询工作错误。它只是从$quan设置数量。我需要马上提前致谢。 最佳答案 在您的第二个和第三个SELECT语句中,我认为您可能需要在$sub周围添加单引号,因此它们将是:$check1=mysqli_query($conn,"SELECT*FROMinstockWHEREs_brand='$sub'");和$check2=mysqli_query($conn,"SELECT*FROMoutstockWHEREs_brand='$sub'");

php - mysqli 查询没有结果 做点别的事 做点别的事

我正在运行mysqli查询。这是我的代码query($SM_pro_info)ordie($db->error);if($QSM_pro_info->num_rows>0){while($SM_pro=$QSM_pro_info->fetch_object()){?>pro_title;?>image_1;?>"alt=""width="60"height="60"border="0"/>الغرض:pro_purpose;?>num_rows);$x++){echo'Youradhere';//or,whateveryouradtextis}}?>现在我想做的就是如果有任何来自mys

php - MySqli 无法连接到本地主机

这个问题在这里已经有了答案:MySQL:Accessdeniedforuser'test'@'localhost'(usingpassword:YES)exceptrootuser(18个答案)关闭去年。我有这行代码:$mysqli=newmysqli("localhost","user","pass","db");我正在为Apache和MySQL使用XAMPP。如果我使用上面的行,它会抛出以下错误:Warning:mysqli::mysqli():(HY000/1045):Accessdeniedforuser'user'@'localhost'(usingpassword:YES)

php - 为什么 mysqli left join 返回 1 行?

我有2个表:1)products2)product_images,它的数据是这样的:productstable:==============ProductIDTitlemodel_number-----------------------------------1title11232title21243title31254title41265title5127product_images==============pi_idp_idproduct_image------------------------------11image122image233image344image451i

php - 如何在 mysqli 中运行选择查询

这个问题在这里已经有了答案:Howtousemysqli_query()inPHP?(1个回答)关闭去年。我需要显示特定的记录,记录存在于数据库中,但它什么也没显示。这是我的代码。$con=mysqli_connect("localhost","root","","test")ordie("ConnectingtoMySQLfailed");$name=$_POST['uname'];$query="SELECT*FROMofficedbWHEREname='.$name.'";$data=mysqli_query($con,$query);while($row=mysqli_fetc