User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,526 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,805 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 4084 | Replies: 16
Reply
Join Date: Mar 2007
Posts: 18
Reputation: thunderbbolt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
thunderbbolt thunderbbolt is offline Offline
Newbie Poster

php mysql drop down list

  #1  
Oct 1st, 2007
I am trying to read my database from mysql. I have two fields author and books. I need the author field to be in the drop down list and then when I choose an author I need it to display below on the same page all of the books by that author in the database. I don't really know how to use php. I know how to connect the database to php but then I don't know how to get the author from the database to the drop down list and then I am not really sure how to display the books below. I am working on this for a small local bookstore and I really want to incorporate this feature for them.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Practically a Master Poster

Re: php mysql drop down list

  #2  
Oct 1st, 2007
Well i can help you with that. i have done this many times. if you will post the authors and the books they have, i will make a script for you that you can view on my server in a couple of hours.
Reply With Quote  
Join Date: Mar 2007
Posts: 18
Reputation: thunderbbolt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
thunderbbolt thunderbbolt is offline Offline
Newbie Poster

Re: php mysql drop down list

  #3  
Oct 1st, 2007
I also have an id field which is a identification number
Reply With Quote  
Join Date: Mar 2007
Posts: 18
Reputation: thunderbbolt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
thunderbbolt thunderbbolt is offline Offline
Newbie Poster

Re: php mysql drop down list

  #4  
Oct 1st, 2007
Originally Posted by kkeith29 View Post
Well i can help you with that. i have done this many times. if you will post the authors and the books they have, i will make a script for you that you can view on my server in a couple of hours.


ID Author Title
1 Patricia Cornwell Preditor
2 Patricia Cornwell Cruel and Unusual
3 John Grisham The Client
4 John Grisham The Firm
5 John Grisham The rainmaker
6 James Patterson Violets are blue
7 Sue Grafton A is for Alibi
8 Janet Evanovich One for the money
9 Janet Evanovich Two for the dough

This is just part of the file
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Practically a Master Poster

Re: php mysql drop down list

  #5  
Oct 1st, 2007
can i use more than one table or does it need to be in one? i will also give you code to create the database tables if you need it.
Reply With Quote  
Join Date: Mar 2007
Posts: 18
Reputation: thunderbbolt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
thunderbbolt thunderbbolt is offline Offline
Newbie Poster

Re: php mysql drop down list

  #6  
Oct 1st, 2007
They only have one table.
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Practically a Master Poster

Re: php mysql drop down list

  #7  
Oct 2nd, 2007
i have finished the code. try it here: http://68.103.192.2:8080/thunderbbolt/index.php.
Reply With Quote  
Join Date: Mar 2007
Posts: 18
Reputation: thunderbbolt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
thunderbbolt thunderbbolt is offline Offline
Newbie Poster

Re: php mysql drop down list

  #8  
Oct 2nd, 2007
Originally Posted by kkeith29 View Post
i have finished the code. try it here: http://68.103.192.2:8080/thunderbbolt/index.php.


This is perfect and exactly what they are looking for. How did you do this? Thank you so much.
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Practically a Master Poster

Re: php mysql drop down list

  #9  
Oct 2nd, 2007
here is the script: http://68.103.192.2:8080/thunderbbolt/download.zip. there is a README.txt file in there i type for you, telling you everything you need to know. if there is any other questions just pm me.
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Practically a Master Poster

Re: php mysql drop down list

  #10  
Oct 2nd, 2007
sorry forgot something in the readme file. i have updated it. please download the zip file again.
my bad
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 4:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC