View Full Version : displaying data from db onto webpage
sarah
05-01-2003, 03:47 PM
Hi All,
I am new to MySQL, I have jus created my test database with one table and 5 rows of data using phpMyAdmin. Now I want to display this data on a webpage using php. Any ideas on how I can do this?
database name is "test"
table is called "users"
Thanks
Sarah
I think the best thing you can do is search for a good tutorial on PHP and MySQL. There are plenty of thoose
Like
http://www.mysql.com/articles/ddws/index.html
sir pannels
05-01-2003, 11:34 PM
Hi Sarah,
yeh find out what languages you can use on your server, id recommend php if you can.
and once you found out - come back and we will help you sort a few things out.
P:thumbsup:
sarah
05-06-2003, 11:38 AM
Hey, thanx for the link - it helped me out heaps. I can now retrieve text from the database - what about images?
Currently in my test database I have 10 products, with their relevant id's, product names and product description. At the moment the images are stored in /images/products/thumbnails. Each image name corresponds with the id.
I.e
Product 1:
Id = 1
Name = Product 1
Desc = Blah blah
Image = 1.jpg
Product 2:
Id = 2
Name = Product 2
Desc = Blah blah
Image = 2.jpg
... and so on
Any ideas on how I can show the image with each product?
Nightfire
05-06-2003, 05:46 PM
Just put the file path into the db, then print out the filepath from the table when you need it. Saves alot of resources than having to fetch an image from a db
What Nightfire suggested + add another column to your db to store an alternative text in (+ even maybe a column to store the height and width of your image in, unless they all have the same size)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.