Hello every one,
I have just recently started learning Mysql/PHP and i am trying to design a page with drop down menus which will allow the user to select what they want to see and submit the query. So far this is how far i have gone, which i am sure is not far.
[PHP]<?PHP
// Connecting to the database server
$link = mysql_connect("connection", "user", "pass");
// Selecting database
mysql_select_db("db");
// Performing MYSQL query
$result = mysql_query('SELECT name FROM location_o2')
or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<form action='#'>\r\n<select name=location>\r\n";
while ($line = mysql_fetch_array($result, MYSQL_NUM)) {
$house = $line[0];
echo " <option value=$house>$house\r\n";
}
echo "</select>\r\n <input type=submit value=SELECT>\r\n</form>\r\n";
?>[/PHP]
The above will create a drop down menu with 2 entry (London, Liverpool). The concept is that the user selects a city and by submiting their choice they can in this case see all the available cars in that city.
any ideas and suggections will be greatly appriciated.
keyvan
12 1593
Welcome to The Scripts, keyvanrahmadi.
What type of suggestions are you looking for?
Welcome to The Scripts, keyvanrahmadi.
What type of suggestions are you looking for?
I am sorry i should have been more clear, whats confusing me is how i can use the user's choice from menu and out put the result on the same page. http://ati.amd.com/support/driver.html
Above link will show you what i have in mind, a bit ambitious for starter like me but hey i like jumping in the deep end and try to figure it out.
keyvan
When I went over to amd's site, are you referring to the drop down menu in regards to selecting your location.
This is handled via Javascript.
Or are you referring to a different part of the page?
I have moved this thread to the Javascript forum. The folks there should be much more helpful.
Hello every one,
I have just recently started learning Mysql/PHP and i am trying to design a page with drop down menus which will allow the user to select what they want to see and submit the query. So far this is how far i have gone, which i am sure is not far.
<?PHP
// Connecting to the database server
$link = mysql_connect(\"connection\", \"user\", \"pass\");
// Selecting database
mysql_select_db(\"db\");
// Performing MYSQL query
$result = mysql_query(\'SELECT name FROM location_o2\')
or die(\'Query failed: \' . mysql_error());
// Printing results in HTML
echo \"<form action=\'#\'>\\r\\n<select name=location>\\r\\n\";
while ($line = mysql_fetch_array($result, MYSQL_NUM)) {
$house = $line[0];
echo \" <option value=$house>$house\\r\\n\";
}
echo \"</select>\\r\\n <input type=submit value=SELECT>\\r\\n</form>\\r\\n\";
?>
The above will create a drop down menu with 2 entry (London, Liverpool). The concept is that the user selects a city and by submiting their choice they can in this case see all the available cars in that city.
any ideas and suggections will be greatly appriciated.
keyvan
Have a read at this thread.
Have a read at this thread.
Or maybe this one.
r0, those links point to http://this/ (!!)
I would like to thank every one for thier input and various hints and links the provided.. it has helped greatly.
keyvan
No problem, you're welcome. If you have any more problems, feel free to post again.
I would like to thank every one for thier input and various hints and links the provided.. it has helped greatly.
keyvan
I am not sure if all the links posted helped you.
I am not sure if all the links posted helped you.
Well, at least the last one did.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: KK |
last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . .
1. Alot of people put them in the
they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up
category (a la...
|
by: Haines Brown |
last post by:
I've implemented the horizontal drop down menu discussed recently in
this newsgroup, and it works nicely under Galeon and Mozilla, but
not IE 5.0.
Here are the problems:
Under IE 5.0, the...
|
by: vikram.cvk |
last post by:
Hello Experts,
Im trying to design a CSS vertical drop down menu which should have the
following functionality.
Home
About Us
|
-->Overview
|
by: hemanth.singamsetty |
last post by:
Hello there,
I've a drop down menu (created using CSS & Javascript -- see code
below).
My problem is, whenever I click a link on the menu
the new page replaces the current page (and the menu...
|
by: simon.cigoj |
last post by:
I have an javascript made menu and some forms with the dropdown
element. When the menu opens and scrolls down the drop down is
displeyed over the menu and obscures the menu choices. I have this...
|
by: phpnewb |
last post by:
Hi, I know i'm doing it wrong, but I'm using a while loop right now to create several instances of a drop down menu. It gives me undesirable results. Can you tell me the right way to do it. Below are...
|
by: rsteph |
last post by:
I have a javascript drop down menu that I borrowed from a website. It utilizes a little .css to help with formatting. The menu works great, and on all 3 of the browsers I'm concerned about; but I am...
|
by: TycoonUK |
last post by:
Hi,
As I do not have IE7 on my computer, I was wondering if there is a
fault in my CSS Menu when using IE7.
Please can someone look at my site - http://www.worldofmonopoly.co.uk
and tell me...
|
by: Kaland |
last post by:
Do the search engines follow links that are within
forms (like the drop-down menu) so that those pages are indexed?
Here is the code for a sample drop-down menu that I created.
<form><select...
|
by: Archanak |
last post by:
Hi,
I am using 2-level CSS Drop Down Menu in my perl/CGI program.
here is the code.
#!c:/perl/bin/perl.exe
use CGI qw(:standard);
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |