Drop down from database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
flyer101
Forum Newbie
Posts: 6
Joined: Sat Apr 07, 2012 6:49 am

Drop down from database

Post by flyer101 »

Hello everyone,

Firstly I would like to say I know I am new to this community and shouldn't be asking help straight away but it is an emergency.

Basically I have a page with a contact form on, simple contact form with name, email, phone, subject, message e.t.c.

What I want to do is add another field which is a drop down menu from a MySQL database.

If you look at: http://www.av8jet.com/charter.php

You can see in the departures box, when you start typing, a list of airports come up, I want to do the same thing from my database but have next to no experience in php and mysql.

I have looked at their code but can't figure it all out.

Anyone who is willing to help we can pay a small fee but this needs to be done urgently,

Thank you for your time,

Flyer101
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

Re: Drop down from database

Post by azycraze »

Try to use any jquery autosuggestion plugin.
That will ease your problem
flyer101
Forum Newbie
Posts: 6
Joined: Sat Apr 07, 2012 6:49 am

Re: Drop down from database

Post by flyer101 »

I'm sorry, do you think you could elaborate?

I appreciate the help so much!

Thanks,

Flyer101
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

Re: Drop down from database

Post by azycraze »

do you need google like auto suggestion?
flyer101
Forum Newbie
Posts: 6
Joined: Sat Apr 07, 2012 6:49 am

Re: Drop down from database

Post by flyer101 »

yes
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

Re: Drop down from database

Post by azycraze »

just google autosuggestion jquery plugin for new ones or just look here

http://www.9lessons.info/2009/06/autosu ... d-php.html

further help assured!
flyer101
Forum Newbie
Posts: 6
Joined: Sat Apr 07, 2012 6:49 am

Re: Drop down from database

Post by flyer101 »

Thank you, how do I link that to a mySQL database though
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

Re: Drop down from database

Post by azycraze »

edit the config.php or just connect to your database in search.php using mysql_connect()
flyer101
Forum Newbie
Posts: 6
Joined: Sat Apr 07, 2012 6:49 am

Re: Drop down from database

Post by flyer101 »

I am completely new to PhP and mySQL so I have no idea what you mean, sorry.
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

Re: Drop down from database

Post by azycraze »

Pls post your codes so that we can help ....
Also try to learn php basics from w3schools.net or some ebooks
flyer101
Forum Newbie
Posts: 6
Joined: Sat Apr 07, 2012 6:49 am

Re: Drop down from database

Post by flyer101 »

Okay I have done some research and sorted out the auto suggestion thing but the thing i am stuck on is putting my .sql file on to my webserver and creating a table then a search column, how do you create a table in cpanel?
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

Re: Drop down from database

Post by azycraze »

do you have a php testing environment in your computer?
If not,it would be better if you setup one so that you can play with php.
To setup a php environment ,setup xampp in your computer.
here is the link
www.apachefriends.org/en/xampp.html
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Drop down from database

Post by Celauran »

Virtual Box + LAMP > XAMPP.

That aside, you should have a link to phpMyAdmin available from cPanel. From there, you can copy the contents of your .sql file into the SQL tab, which should create the table for you.
williamsmith518
Forum Newbie
Posts: 1
Joined: Mon Apr 09, 2012 7:18 am

Re: Drop down from database

Post by williamsmith518 »

edit the config.php or just connect to your database in search.php using mysql_connect()

-----------------------------------------------
Patent tescili
Post Reply