我从数据库中获得了不需要的数 [英] I got unwanted data from database.
本文介绍了我从数据库中获得了不需要的数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ image = addslashes(file_get_contents($ file [' tmp_name的值'跨度>]));
$ image_name = addslashes($ file [' name']);
$ qry = INSERT INTO` cart``photo`(`id`, `iname`,`description`,`price`,`shipping`,`quantity`,`name`,`image`)VALUES('','$ iname','$ desc','$ price','$ shipping','$ qunt','$ image_name','$ image');
我在我的数据类型中使用此代码进行插入我的图像列是BLOB。
当我从数据库中检索图像时,我得到了一些无法识别的代码。
显示图片:
echo ' < img src ='。$ get_row [ ' image']。' height =150oxwidth =150pxalt =image/>';
解决方案
image = addslashes (file_get_contents(
file [' tmp_name'])) ;
IMAGE_NAME =和addslashes(
hi,
$image=addslashes(file_get_contents($file['tmp_name']));
$image_name=addslashes($file['name']);
$qry="INSERT INTO `cart`.`photo` (`id`, `iname`, `description`, `price`, `shipping`, `quantity`, `name`, `image`) VALUES ('', '$iname', '$desc', '$price', '$shipping', '$qunt', '$image_name','$image')";
I have using this code for inserting, in my datatype of my image column is BLOB.
when I am retrieving the image from database I got some unrecognized code.
display image:
echo '<img src="'.$get_row['image'].'" height="150ox" width="150px" alt="image" />';
解决方案
image=addslashes(file_get_contents(
file['tmp_name']));
image_name=addslashes(
这篇关于我从数据库中获得了不需要的数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文