Hi
I am trying to make a bike shop for my project and i need to pull out a product details with image from sql databse. I have made a table with products and i have stored the images url but i have no idea how to pull it out on to php. All i get is the url in text. Can any one help?
kamil.metkowski 0 Newbie Poster
Recommended Answers
Jump to PostIf you can get the URL in text all you have to do is put it into an HTML
<img>
tag:<img src="<?php echo $row['image']; ?>" alt="your alt text" />
Jump to PostI fyou showed your table and any code that you've tried?
Jump to PostI have tryde to use <img src="<?php echo $row['picurl']; ?>" alt="your alt text" /> but it didn't work for some reson :/
SO what do you get?
Jump to PostI was told it's not a good practice to store images in a database because they take lots of space in the database?
What is the best solution to that?
Jump to PostI think you took
$row['image']
from the code I provided in my original response. Should it not be$row['picurl']
instead? If you want the image to appear where you wroteecho ' <br /> Image:
above, replace line 9 with the following code:echo …
All 23 Replies
EvolutionFallen 107 Junior Poster

diafol
kamil.metkowski 0 Newbie Poster

diafol
rotten69 20 Posting Whiz
rotten69 20 Posting Whiz
IIM 163 Master Poster
kamil.metkowski 0 Newbie Poster
radhakrishna.p 29 Posting Whiz in Training
kamil.metkowski 0 Newbie Poster
radhakrishna.p 29 Posting Whiz in Training
kamil.metkowski 0 Newbie Poster
kamil.metkowski 0 Newbie Poster
Webville312 14 Newbie Poster
kamil.metkowski 0 Newbie Poster
Webville312 14 Newbie Poster
kamil.metkowski 0 Newbie Poster
naphets 0 Junior Poster in Training
rotten69 20 Posting Whiz
IIM 163 Master Poster
kamil.metkowski 0 Newbie Poster
kamil.metkowski 0 Newbie Poster
EvolutionFallen 107 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.