473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I want to display image blob from db to fpdf

Here is my code but it error
================================================== ===
Expand|Select|Wrap|Line Numbers
  1. $this->Cell(
  2.     15,
  3.     15,
  4.     this->Image(
  5.         $row['image'],
  6.         $this->GetX(),
  7.         $this->GetY(),
  8.         15,
  9.         15
  10.     ),
  11.     1, 0
  12. );
Jul 21 '20 #1
2 4292
gits
5,390 Expert Mod 4TB
what error do you get exactly?
Jul 21 '20 #2
bakertaylor28
45 32bit
The problem is that you can't pull from the SQL directly in FPDF, rather you need to store the blob in a global var and then use that, because FPDF can't interact with the SQL statement, because it is a class. A class can't interact with variables constructed outside the class UNLESS it is a global var. Thus you need something like:

Expand|Select|Wrap|Line Numbers
  1. global $image;
  2. $image = $row['image]';
  3. ...
  4.  this->Image(
  5.         $image,
  6. $this->GetX(),
  7.         $this->GetY(),
  8.         15,
  9.         15
  10.     ),
  11. ...
  12.  
Mar 4 '21 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Philipp Lenssen | last post by:
I created Search.CSS which grabs Google results (using the Web API), displays as XHTML1.0 Strict + CSS, and recently also adds Thumbnails....
3
by: Mark | last post by:
Hello all - I'm at wits end with trying to figure out why I'm having this problem since I followed the research, that I've dug up, to a "T". I'm trying to display a JPEG image from a path...
2
by: Olav Tollefsen | last post by:
How can I display photo images stored in a SQL Server 2000 databases in a DataList or DataGrid without having to write the images to files first? Olav
1
by: Tan | last post by:
Hi I am desperate for any help with display image in Gridview I have a gridview contain surname , forename ..... and image. I could not display image as my database store the column image as...
4
by: Piedro | last post by:
Hi group, how do I read a image/blob field in cas option strict is on? First I had it turned off and I read it like this: Dim b() As Byte If Not dsSupp.Tables(0).Rows(0).Item("BITMAP") Is...
2
by: RedSouljaz | last post by:
Hi, How to display image that was saved in database ms sql server 2000 into picture box. The field type that I use in database is Images I can save to database but cannot show from database. ...
2
by: David | last post by:
I am trying to get an image to appear on all Mondays within the calendar control. I also want that image to be a link. How can I do this?
3
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
1
adelemb
by: adelemb | last post by:
Hi all, I want an image to display in a table if another table cell shows an updated date of less than 24hours. The date displayed in the cell is already working and display fine, but I have no...
0
by: dbdb | last post by:
hi, i work with ms. access 2003 i want to display image from a folder to the report. i have read thread in http://bytes.com/topic/access/answers/191611-pictures-access-reports but that's...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.