Search the Community
Showing results for tags 'drop down menu'.
-
Hi all, I am new to this (programmed on mainframe many years). I created a dropdown selection populated from an SQL table. my problem is if I use mysql_*, the selection is populated and works correct but if I change the mysql_* to mysqli_*, it will not work (I know my connect and slect database work, because i do not go into "or die" part). My coding below: $intIdField = 'code'; $strNameField = 'name'; $strTableName = 'country'; $strNameOrdinal = 'name'; $strMaskName = 'select country'; $strOrderField = 'name'; $strMethod="ASC"; echo "<select name=\"$strNameOrdinal\">\n"; echo "<option value=\"NULL\">".$strMaskName."</option>\n"; $strQuery = "select $intIdField, $strNameField from $strTableName order by $strOrderField $strMethod"; if (!$strQuery) { die("query failed:" . mysql_error()); } echo mysql_query ("set character_set_results='utf8'"); $rsrcResult = mysql_query($strQuery); while($arrayRow = mysql_fetch_assoc($rsrcResult)) { echo $row["name"]; echo $row["code"]; $strA = $arrayRow["$intIdField"]; $strB = $arrayRow["$strNameField"]; echo "<option value=\"$strA\">$strB</option>\n"; } echo "</select>"; It only populates the block with "select country" but if you click on the down arrow, notyhing comes up. as I say, the above coding work but as soon as I change to mysqli, it does not, what am I doing wrong? Thank you in advance
-
I've been looking at this for a bit and can't seem to figure what's going on? I have used this code before and never had this issue.... I'm tryig to populate a dropdown menu from a MySql DB. The dropdown menu seems to skip the first array... I attached a screenshot that hopefully show's what I'm talking about.. any thoughts?
- 3 replies
-
- php
- drop down menu
-
(and 2 more)
Tagged with:
-
Hi, I have found a script off the internet that is very simple, it just allows my menu to have a drop down list. It is basically this script: http://jsfiddle.net/297t6/ Here's the change I want to make that I don't know how to do: When the user hovers over a menu item, it drops down; if you then hover over another menu item, that first menu item is still sliding down and then coming back up. I want the drop down to disappear as soon as the user hovers over the next menu item. Is this possible to implement with this code: $(function(){ $('ul#menu li').hover(function(){ //$('#drop' , this).css('display','block'); $(this).children('ul').delay(0).slideDown(500); }, function(){ $(this).children('ul').delay(0).slideUp(50); }); });
-
Hi, i want to build a dynamic mega drop down menu using php please help me how to do this. regards, Anil
- 1 reply
-
- drop down menu
- dynamic menu
-
(and 1 more)
Tagged with:
-
Hi there I am trying to create a search form to retrive rates form multiple selections and then display the results. i have created the database in mysql database name: Rates in that there are the following 6 tables:- 1.Country 2.Area 3.Region 4.destination 5.airline 6.rate_table 1)The country has the following columns:- Country_code,Country_name,Area and Region 2)The Area table has the following columns:- Area_code,Area name and Country 3)The Region table has the following coulumns:- Region_Code,Region_Name and Country 4)The destination has the following columns:- Dest_Code,Dest_Name and Dest_Country 5. The Airline Table has the following columns:- Airline_Code and Airline_Name 6) The Rates Table has the following columns:- Rate_ID,Rate_Airline,Rate_Destination and Rate I managed to create my first drop down using the code below:- <?php //create connection $connectmysql=mysql_connect("localhost","root","root"); if (!$connectmysql) { die('Not Connected :' . mysql_error()); } $db_selected=mysql_select_db('rates',$connectmysql); ?> <?php $result = mysql_query("SELECT Country_Name FROM Country ORDER BY Country_Name") or die(mysql_error()); while ($row=mysql_fetch_array($result)) { $Country_Name=$row["Country_Name"]; $options.='<option value="'.$row['Country_Name'].'">'.$row['Country_Name'].'</option>'; }; ?> <html> <body> <SELECT NAME=catid> <OPTION VALUE=0>choose</option> <?php echo $options;?> </SELECT> </HTML> the stucture plannned is country-->region--->Area--->destination--->Airline and then search. if the country is selected then the next drop down should show the region automatically in the next dropdown and for the area drop down.The destination drop down should only show destinations for the county selected and the airline should only show the list of airlines. then the rate results should show based on these cliterias. Thanks and Regards Keith
- 2 replies
-
- php help
- seach form
-
(and 1 more)
Tagged with: