无法在phpMyAdmin中添加图像路径

无法在phpMyAdmin中添加图像路径

问题描述:

I was just working on my PHP website and I need database for that, so I was trying to insert image path to phpMyAdmin.

But I am unable to add path because I don't know the exact syntax for image path and also when I am trying to insert image path.

I can't see empty column instead of that. I am watching something like binary and choose file, as you can see in image.

enter image description here

我刚刚在我的PHP网站上工作,我需要数据库,所以我试图插入图像路径到 phpMyAdmin的。 p>

但是我无法添加路径,因为我不知道图像路径的确切语法,也不知道当我尝试插入图像路径时。 p> 我看不到空列而不是那个。 我正在看二进制文件,然后选择文件,如图所示。 p>

p> div>

Its good to save files / images in folders and just save their name in database.

<input type="file" name="photo">


$tmpFile = $_FILES['file']['tmp_name'];
$newFile = $_FILES['file']['name'];
move_uploaded_file($tmpFile, '/images/'.$newFile);

$query = "update users set photo = '$newFile' where id = '$userId'";

Here I assume that we are going to upload profile photo of users and saving file in images folder. Also, updating file name in database record.