php从mysql中获取图片并显示解决方法
php从mysql中获取图片并显示
include("conn.php");
$rs=mysql_query("SELECT products_images.name
FROM products_images
JOIN products_to_images ON products_images.id = products_to_images.images_id
JOIN products ON products.id = products_to_images.products_id
WHERE `ppcode` LIKE 'ACK4211N.002' ");
while($row=mysql_fetch_array($rs))
{
echo "$row[name]
";
}
?>
打印出来只是图片是名字呢,如123.jpg。我想要的是图片能显示出来
------解决方案--------------------
你的name保存的是什么内容先 如果只是图片的名称 你要知道保存的路径 然后拼接一下就可以显示图片了
------解决方案--------------------
------解决方案--------------------
捉急啊 你自己都不知道 上论坛问 我们就知道? 又没黑了你的主机
自己搜索下 123.jpg 在那个文件夹 不就知道了
------解决方案--------------------
入库的时候为何不把路径一起写入呢?
------解决方案--------------------
echo "
------解决方案--------------------
写入数据库的时候就应该把文件我写进去
然后 定义一个目录常量,根据这个常量路径去读取这个文件名
------解决方案--------------------
------解决方案--------------------
楼上正解,你把孩子他妈$row[name]弄丢了,孩子会不跟你闹脾气吗?

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

With the Skyline, HMD Global is set to unveil a mid-range smartphone in the style of the Nokia Lumia 920 on July 10. According to the latest information from the leaker @smashx_60, the Lumia design will soon also be used for a tablet, which will be c

Oneofthecontestsheldby1839Awardsin2024wasspecialinthatsubmissionstoitweretobegeneratedbyartificialintelligenceratherthancreatedwithacamera.ItwasthiscontestthatpiquedthecuriosityofacertainMilesAstray.Insteadofus

What is the use of name in Vue3? 1. Name needs to be defined when making recursive components. 2. The component can be cached with keep-aliveincludeexclude. 3. When Vue reports an error or is debugging, you can see the name of the component. Vue3 defines name1. It is automatically generated as long as the setup syntax sugar mode single file component is turned on in the script. The corresponding name option will be automatically generated based on the file name. For example, Tree.vue, then its name will be automatically generated by Tree. This has a drawback. If you want to modify the name, you need to modify the component name. If there is a place to import the component, you need to modify it together. 2. Open a script to define name

PHP cannot get the name because when the name and id values of the form element are different, the browser cannot recognize it. The solution: 1. Check whether some form elements and frame elements use name; 2. Check only Elements that can be assigned ID but not name; 3. For multi-select box checkbox, you can use "join(',', $__POST['name'])" to form data.

With the Skyline, HMD Global is set to unveil a mid-range smartphone in the style of the Nokia Lumia 920 on July 10. According to the latest information from the leaker @smashx_60, the Lumia design will soon also be used for a tablet, which will be c

图片消失如何解决先是图片文件上传$file=$_FILES['userfile']; if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。
