Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 24th, 2008, 3:20 PM   #1
mattireland
Hobbyist Programmer
 
mattireland's Avatar
 
Join Date: Jul 2007
Location: Wales, United Kingdom
Posts: 201
Rep Power: 2 mattireland is on a distinguished road
Send a message via MSN to mattireland Send a message via Skype™ to mattireland
Linking fields in a database

Hi,

I've been looking all over for how to do this but unfortunately haven't been able to find anything... I really hope you can help me please!

I've used navicat to create my database and i've linked two fields: category from table photos and id_cat from table categories - or at least tried to - i think it's worked!

So next, I want to create a drop down menu on my page to display a list of categories (I can do this ) and then I want to make it so that when the user submits the form, they will see a list of things from table photos with that id displayed below (this is the bit i'm having trouble with!)

Thanks very, very much and if you need clarification please do say!

Matt. I
__________________
Matt Ireland
http://www.mattireland.org
matt@mattireland.co.uk
mattireland is offline   Reply With Quote
Old Jan 24th, 2008, 7:15 PM   #2
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
Re: Linking fields in a database

I don't understand much about manipulating databases Matt, but if you can retrieve the photos and their respective ids into some variable in your script all you would need to do is set up a form using the POST method for instance, and then check that the category they submitted exists. If it does go to that category, retrieve your info from the database and output it in whatever format you like. So is it the actual $_POST array you're having trouble with? Or outputting the images/text? Can you retrieve the data you created at all?
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Jan 24th, 2008, 9:39 PM   #3
Syntax_Error
Programmer
 
Syntax_Error's Avatar
 
Join Date: Jan 2008
Posts: 9
Rep Power: 0 Syntax_Error is on a distinguished road
Re: Linking fields in a database

Yeah, please be more specific exactly where your problem is. You should be able to take the post data, run some variable thats connected to the database through a query, and get the results formatted and outputted. Where exactly is the problem?
Syntax_Error is offline   Reply With Quote
Old Jan 25th, 2008, 3:10 AM   #4
mattireland
Hobbyist Programmer
 
mattireland's Avatar
 
Join Date: Jul 2007
Location: Wales, United Kingdom
Posts: 201
Rep Power: 2 mattireland is on a distinguished road
Send a message via MSN to mattireland Send a message via Skype™ to mattireland
Re: Linking fields in a database

Sorry, I didn't realise it was that simple! I just did that!

Sorry for being such a noob and thank you very much!
__________________
Matt Ireland
http://www.mattireland.org
matt@mattireland.co.uk
mattireland is offline   Reply With Quote
Old Jan 27th, 2008, 5:28 PM   #5
kishou
Programmer
 
Join Date: May 2007
Posts: 52
Rep Power: 2 kishou is on a distinguished road
Re: Linking fields in a database

you can use JOIN/UNION
http://www.w3schools.com/sql/sql_join.asp
kishou is offline   Reply With Quote
Old Jan 28th, 2008, 1:11 AM   #6
mattireland
Hobbyist Programmer
 
mattireland's Avatar
 
Join Date: Jul 2007
Location: Wales, United Kingdom
Posts: 201
Rep Power: 2 mattireland is on a distinguished road
Send a message via MSN to mattireland Send a message via Skype™ to mattireland
Re: Linking fields in a database

Navicat does that nicely for you but thanks!

It might actually be easier to do it by hand though!

Thanks again!

Matt. I
__________________
Matt Ireland
http://www.mattireland.org
matt@mattireland.co.uk
mattireland is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Database Tables ReggaetonKing Coder's Corner Lounge 4 Jan 23rd, 2008 7:56 AM
Storing BLOBs in a database - problem jonyzz Other Programming Languages 8 Jan 31st, 2007 4:38 AM
searching an access database? designXperts.net Visual Basic .NET 12 Nov 27th, 2005 5:03 PM
Using ODBC to connect to a remote database in a C program bigi C++ 1 Mar 8th, 2005 3:19 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:04 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC