Jump to content

Just some advise..


eugene2009

Recommended Posts

Hello, I have this site that displays different galleries of cars.. On there, I have an admin page where it allows the administrators to upload different pictures of different cars.  So heres my problem.. just to start browsing the viewer would have to go to something called..

 

categories.php

 

Here I would like all the different types of makes displayed that are hyperlinked to the next page on where to select a model...

So say my admin wants to add a new photo to  a category that doesnt exist.. he selects lamborghini for example and uploads the pic into that category.. that way in categories.php it would automatically show up a new category because of the mysql fetch function.

 

Something like this:

 

$query = "SELECT * FROM cars ORDER BY makeid"; 
$result = mysql_query($query); 

while($row = mysql_fetch_assoc($result)){

echo "<a href=\"view_categories.php?id=' . $row['makeid'] . "\">' . $row['makeid'] . '</a>";

 

So pretty much where it will fetch all the categories and link them all on one page.. I have it all figured out but the way my mysql database is setup it displays the same link x number of pictures there are because i do not understand how to set it up correctly.. i googled it over 100 times and I cant find what im looking for.. somebody please help me..

 

 

Link to comment
Share on other sites

Since you are using makeid surely you have an independent table that contains information relative to the make such as make id along with make name? If not it sounds like you want something like...

 

SELECT DISTINCT makeid FROM cars ORDER BY makeid

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.