gpt4 book ai didi

php - 当我在bind_param上工作时,我正在用php的OOPs概念制作一个用于图像上传的函数,我不知道图像s或i

转载 作者:行者123 更新时间:2023-11-30 00:42:00 25 4
gpt4 key购买 nike

我正在用 php 的 OOP 概念制作一个用于图像上传的函数,当我处理 bind_param 时,我不知道图像,或者我的主要问题是在绑定(bind)参数标记中,此代码不完整,我只显示我的问题,请帮助我。 ..

include('include/connect.php');
$imgData=addslashes(file_get_contents($_FILES[][]);
$imageProperties=getimagesize($_FILES[][]);

$res=INSERT into user
}
}




function addStudent($username,$password,$imageSize,$imageData)
{
$addS=$this->conn->prepare('');
$addS->bind_param();
$addS->execute();

}

真正的问题在这里

$addS->bind_param();

“ssss”或“ssii”

最佳答案

这取决于您要绑定(bind)的值:

                  Type specification chars
Character Description
i corresponding variable has type integer
d corresponding variable has type double
s corresponding variable has type string
b corresponding variable is a blob and will be sent in packets

如果 $imageSize 和 $imageData 是字符串:'ssss'

如果 $imageSize 和 $imageData 是整数:'ssii'

http://www.php.net/manual/en/mysqli-stmt.bind-param.php

关于php - 当我在bind_param上工作时,我正在用php的OOPs概念制作一个用于图像上传的函数,我不知道图像s或i,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21695302/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com