|
Author |
Message |
horhe
Junior WebHelper
Joined: 05 Nov 2002
Posts: 1
|
Posted:
Tue Nov 05, 2002 3:20 pm (22 years, 1 month ago) |
|
Hi all .. hope u dont mind asking this before doing something stupid....
lets say i have a 1000 pictures database ...so my question is :
Is it posible to give each pic a link (url) , so when a make query in sql ..
the html page displays name of the pic and a link to it in separate column ..
What should i use ... ? I use dreamweaver and im learnin Php.
Thanks ... |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Nov 05, 2002 5:30 pm (22 years, 1 month ago) |
|
Yes, it is possible. What do you need help with?
I would have one "id" field, and then all the other fields you need. Then have a page which displays them all, and link each one to pic.php?id=IDHERE. Then when pic.php is called, it performs the query "SELECT * FROM tablename WHERE id=$HTTP_GET_VARS['id']" |
________________________________
|
|
|
|
drathbun
WebHelper
Joined: 01 Mar 2003
Posts: 69
Location: Texas
|
Posted:
Sat Mar 01, 2003 10:24 pm (21 years, 10 months ago) |
|
horhe wrote: | lets say i have a 1000 pictures database ...so my question is :
Is it posible to give each pic a link (url) , so when a make query in sql ..
the html page displays name of the pic and a link to it in separate column ..
What should i use ... ? I use dreamweaver and im learnin Php. |
Let's assume that you have a database table with the picture name and an image file name in it. You would need both of those to do what you're asking, so it's probably a safe assumption. You want to query your database, and display the results on a web page.
There is more than one way to do it, certainly. You could retrieve the picture name and image file name using php, and build the URL there. Or you can select / compose the URL all at the same time. Something like this:
Code: | Select picture_name, '<img src="filename">'
from picture_table |
This is the most basic idea. You would probably want to include image height and width information in your database, you consider storing both thumbnail and full size image links... the possibilities are endless.
I have a photography web site, and the entire site is built by a perl script. Well, the structure of the site, anyway. I still have to enter the text. But if I add a new image to my database, I can reference that image anywhere on my site by it's name and the next time I generate (compile?) my web site it builds the img links and clickable URL's automatically. Very cool stuff, if I do say so myself. |
________________________________ Dave
Photography Site :: Query Tools Forum :: Weekend Fun |
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.12686 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |