4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Newbie question : URL links in mysql ???
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
horhe
Junior WebHelper
Junior WebHelper


Joined: 05 Nov 2002
Posts: 1

PostPosted: Tue Nov 05, 2002 3:20 pm (22 years, 1 month ago) Reply with QuoteBack to Top

Hi all .. hope u dont mind asking this before doing something stupid.... Rolling Eyes

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 ...
OfflineView User's ProfileFind all posts by horheSend Personal MessageVisit Poster's WebsiteICQ Number
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Nov 05, 2002 5:30 pm (22 years, 1 month ago) Reply with QuoteBack to Top

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']"

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
drathbun
WebHelper
WebHelper


Joined: 01 Mar 2003
Posts: 69
Location: Texas

PostPosted: Sat Mar 01, 2003 10:24 pm (21 years, 10 months ago) Reply with QuoteBack to Top

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. Smile

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. Smile 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. Wink

________________________________
Dave
Photography Site :: Query Tools Forum :: Weekend Fun
OfflineView User's ProfileFind all posts by drathbunSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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