草庐IT

mysqli_close

全部标签

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 - 如何在考虑事务的情况下使用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 - sess_expire_on_close 不工作

我有一个问题..在$config['sess_expire_on_close']=TRUE;当我关闭浏览器时..session仍然保存在数据库中。我仍然可以在user_data列中看到数据。config.php$config['sess_cookie_name']='ci_session';$config['sess_expiration']=2400;$config['sess_expire_on_close']=TRUE;$config['sess_encrypt_cookie']=FALSE;$config['sess_use_database']=TRUE;$config['s

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

php - 使用 php 单例的几个 mysqli 查询

我有一个非常常用的mysqli类来为应用程序的其余部分提供数据库连接:classIabDBextendsmysqli{privatestatic$instance=null;//dbconnectionconfigvarsprivate$user="xxx-lit";private$pass="xxx";private$dbName="xxx";private$dbHost="xxx";privatefunction__construct(){parent::__construct($this->dbHost,$this->user,$this->pass,$this->dbName)

php - ZipArchive::close():重命名临时文件失败:权限被拒绝

当我尝试删除压缩目录中的文件时,我遇到了这个奇怪的错误:ZipArchive::close():Renamingtemporaryfilefailed:Permissiondeniedin/MyDirectory/myphpscript.php这是我的代码:open($compressedDirectoryPath)===true){if($zip->deleteName('SampleZip/samplefile.txt')===true){echo'Filedeleted';}}$zip->close();//theerrorispointinghere?>echo成功执行并打印F