pictures in mysql databases

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

CharlieMouse

Thread Starter
Joined
Jun 13, 2003
Messages
148
Hey

I'd like to create a web driven website that uses mysql and php.
I neef ot find a way to be able to let a websurfer search my site for pictures. ex.

I got a ton of pictures of cars, I like them to be able to select form a pull down menu a year than a model and use the webserver display the list of pictures in the form of a table.


I have been working with Mysql for a while and the thing I need most is advice on how to set up the database, what should be in each field, and how to search a DB though a website.

I know the basic commands. I understand to display the results from a search(a little bit). I need a sample code of a DB and Php.
once I know how to start it out, I can go from there

charlie
 
Joined
Dec 14, 2001
Messages
105
I have been working with Mysql for a while and the thing I need most is advice on how to set up the database, what should be in each field, and how to search a DB though a website.
(FYI, I'm not all that good at databases, so take this with a grain of salt.)

There are a few ways to do this. The following may not be the best, depending on the data used, but it should work:

For the table, the basic method would be to index by filename, (consider keeping it descriptive, through name or directory, in order to aid crash recovery) then include search terms. The details would depend on the categories you have. If all you have are cars, and aren't planning on adding anything more, then just fields of 'model', 'year', and whatever else could work. If you have a few more categories, then consider having:
Code:
'filename', 'main_cat', 'sub_cat1', 'sub_cat2' . . .
where each sub_cat corresponds with a subdirectory.

This works well if the data can be placed in a hierarchy. If you want a more flexible solution, try this:
Code:
'filename', 'search_term'
Here, the primary key would either be an unused number, or a composite key made from the two fields. Here, to search, a term is entered, and all rows with that as the 'search_term' are returned. Obviously, each file will take up more than one row. Another table could be created to give non-search data. For example:
Code:
'filename', 'file_ext', 'file_width', 'file_height', 'file_copyright'
Without knowing the variety of data, it is hard to give an optimal solution. However, one of these might work.
 

CharlieMouse

Thread Starter
Joined
Jun 13, 2003
Messages
148
thanks

I brought a book on php and mysql I had no Idea Php was that usefull, Its like wow, I already wished I would have knowned this years ago, Its using code helps save writing html, like includes, and loops, etc. I am sure I will find a way using php to search mysql, as for the format of the datbase itself I thing your wright, I'll give that a try.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top