Hi guys,
I have searched all over the place for help with this one.
I am after a script that will allow users to search my site but with a slight twist.
I have 2 tables, each with similar results.
example:
PS3 NTSC
MotorStorm
PS3 PAL
MotorStorm
What i am after is some way to search one of the tables so the user can select either PS3 NTSC or PS3 PAL then it would display the results the user is after.
Any one have any ideas?
Thanks in Advance.
Search 2 MySQL Table with PHP?
Moderator: General Moderators
-
influenceuk
- Forum Commoner
- Posts: 42
- Joined: Tue May 08, 2007 7:48 am
- Location: London, UK
-
influenceuk
- Forum Commoner
- Posts: 42
- Joined: Tue May 08, 2007 7:48 am
- Location: London, UK
Ok both table will be the same, however on will hold PAL titles, the other would hold NTSC.
basically it would look like this...
Title | Release Date | Price |
That im after is on the search box, to have a drop down selection for PS3 NTSC, and PS3 PAL.
then depending on which of the PS3 options the user choses it would then search the correct table.
Is that ok? or would you like more, its hard to expalin
basically it would look like this...
Title | Release Date | Price |
That im after is on the search box, to have a drop down selection for PS3 NTSC, and PS3 PAL.
then depending on which of the PS3 options the user choses it would then search the correct table.
Is that ok? or would you like more, its hard to expalin
-
influenceuk
- Forum Commoner
- Posts: 42
- Joined: Tue May 08, 2007 7:48 am
- Location: London, UK
i found this...
http://php.about.com/od/phpwithmysql/ss ... arch_2.htm
which shows the idea of the search bit, however i need it to search 2 tables rather than some coloums. lol just to be awkward!
http://php.about.com/od/phpwithmysql/ss ... arch_2.htm
which shows the idea of the search bit, however i need it to search 2 tables rather than some coloums. lol just to be awkward!
-
influenceuk
- Forum Commoner
- Posts: 42
- Joined: Tue May 08, 2007 7:48 am
- Location: London, UK
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The problem is there's a great deal of duplication in having two tables like this.
Generally if I were setting up such a database I would design it where there were probably three tables (with additional linking tables, potentially.) One for the main entry associated with the game; one for secondary titles (i.e. the game goes under a different title in X region, but it's still the same game.) and finally one for platform, media-format, signal-format and price.
The main entry wouldn't hold much of anything, it may in fact be a linking table in fashion. The platform (XBX, X360, PS3, PS2, PS1, PSP, AGB, NGC, etc), media-format (DVD, CD, Cart, UMD, whatever) and signal-format (NTSC, PAL, SECAM, Mesa-SECAM, etc) columns of the third table would likely be SETs.
Generally if I were setting up such a database I would design it where there were probably three tables (with additional linking tables, potentially.) One for the main entry associated with the game; one for secondary titles (i.e. the game goes under a different title in X region, but it's still the same game.) and finally one for platform, media-format, signal-format and price.
The main entry wouldn't hold much of anything, it may in fact be a linking table in fashion. The platform (XBX, X360, PS3, PS2, PS1, PSP, AGB, NGC, etc), media-format (DVD, CD, Cart, UMD, whatever) and signal-format (NTSC, PAL, SECAM, Mesa-SECAM, etc) columns of the third table would likely be SETs.