Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Dropdown box containing values from database.

Codes here !

Moderators: macek, egami, gesf

Dropdown box containing values from database.

Postby chrisf2012 » Wed Feb 20, 2013 11:01 am

I am new to both MySQL and PHP so I really need help!

I have two tables 'Employee' and 'Holiday'.

in my holiday table I have the field 'employee ID' which is a foreign key from the primary key in the employee table.

I am creating a form where employees book holiday. so in the form you enter employee id, first/last name and date of holiday.

Can I have a drop down box in my holiday form for employee ID, where the values in the drop down box are the employee ID's from the employee table?

I apologise if you can not understand my explanation but I appreciate all help! Thanks

in short, I want a dropdown box to contain values of data that is already in the database! thanks
chrisf2012
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Feb 20, 2013 10:58 am

Re: Dropdown box containing values from database.

Postby chrisf2012 » Thu Feb 21, 2013 8:26 am

anyone?
chrisf2012
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Feb 20, 2013 10:58 am

Re: Dropdown box containing values from database.

Postby Jimbojames30 » Mon Mar 11, 2013 12:41 pm

Hi mate,

new as well, i managed to get a dropdown box in my site, have you got a connection to your database?

if so click on the Bindings tab next to databases, then click on the + icon just below, click on recordset (query)

change the name,

on the tables drop down select the table where you have the data for the list

work down the options,

once done click on bind and bind it to the field you want
Jimbojames30
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Mar 09, 2013 1:30 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.