![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
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 |
|
|
|
|
|
#2 |
|
King of Portal
|
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 |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jan 2008
Posts: 9
Rep Power: 0
![]() |
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?
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
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! |
|
|
|
|
|
#5 |
|
Programmer
Join Date: May 2007
Posts: 52
Rep Power: 2
![]() |
Re: Linking fields in a database
you can use JOIN/UNION
http://www.w3schools.com/sql/sql_join.asp |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |