Dynamic MySQL Nav Menu Sorting
I have this dynamic menu and I want to change the order of the menu items... I added a column in the database wich has an integer value for ordering the menuitems. But the only way is by hardcoding them into the database.
I would like a way to sort them with drag-and-drop or with up/down arrows.
Do you think that except PHP & MYsql I will need Javascript as well ? Any ideas how to do that ?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Mysql Php Dynamic Menu
I am trying to write a script that will create dynamically a menu from MySQL database. The database table is a product categories table and it has the folowing filed: category_id, parent_category_id, category_name (some other fileds are there as well but these are enough to figure out the logic) I know that I have to store all the product_categories records in a temp array and then some how go through them and store the level of each record in the menu.... If you have done something like that I suppose you know what I mean and I would much appreciate to give me a hint here ... I had a look in the phpLayersMenu from sourceforge but it is really advanced OO code and I cannot understand the logic.... My target is to create a Tree menu with no pre - defined number of records...
Dynamic Menu CSS
I am trying for a long time now, to find a way of creating a dynamic drop down menu. I have the CSS part ready and working and also I have the first level of the menu working. the problem I have is how can I submit the id from the first level menu in order to make the query and create the second level and so on menu. I am trying to avoid Javascript but I can't see another way at the moment... What I want to achieve is to produce the menu on HOVER if that is not possible on click will be ok as well. Do any of you have an idea ? This is the code I have : ********************************************** <div id="menu"> <ul> <li><h2>Products</h2> <ul> <?php do { ?> <li><a href="?cat_id=<?php echo ($row_product_categories['prod_category_id']); ?>"title="<?php echo strtoupper($row_product_categories['prod_category_name']); ?>"><?php echo ucfirst($row_product_categories['prod_category_name']); ?></a></li> <?php } while ($row_product_categories = mysql_fetch_assoc($rs_product_categories)); ?> <ul> <?php do { ?> <li><a href="index.php?id=<?php echo ($row_products['prod_id']); ?>"title="<?php echo strtoupper($row_products['prod_name']); ?>"><?php echo ucfirst($row_products['prod_name']); ?></a></li> <?php } while ($row_products = mysql_fetch_assoc($rs_products)); ?> </ul> </li> </ul> </li> </ul> </div> **************************************************
Dynamic Navigation Menu
I need to build a dynamic menu that will include certain links depending on what variables are in the URL. This is doable - right? For example: catalog.php?product=widget&color=green Menu would look like: Green Widgets Brand 1 Green Widget Brand 2 Green Widget Brand 3 Green Widget etc. Any help would be greatly appreciated!
Dynamic Select Menu
I am trying to populate a select menu with data from a mysql db. I get the select menu, but no content or errors. The two fields are id and websites. Here is the code:
Dynamic Drop Down Menu
I'm having difficulties displaying the MakeModelID for a row selected from a drop down menu I've populated from a table combining three attributes (Make, Model and Specification - for example Ford Transit LWB 350 HR). What I require is to capture in a variable, such as $MakeModelID, the ID for that record selected. Code:
Creating Dynamic Drop Down Menu
I have a mysql database called Auditions with a table called Sept7. The table has two columns Time and Name. I want to create a dynamic pull down menu and populate it with items pulled from the table based on a query. Code:
Dynamic Message Board Menu
Here's an issue I've spent the last 8 hours trying to get my head around, I'm pretty sure the answer is simple enough, but I just cannot work it out, any help would be much appreciated...even just a function name or something... I have a very simple message board setup. The browse menu will look end up like below, all dynamically fed from a database, which is currently setup as: [articleID] [articleDate] [articleText] 23 2007-07-18 Lorem ipsum dolor.... The 'articleDate' field is a DATE type, formatted yyyy-mm-dd. All posts should be sorted ascending, latest first. I want nothing to be hard coded, so there could be 2 posts in any month, or 200, or there could be no posts in any year. 2007 June - #1 - #2 August -#1 September -#1 -#2 2008 January -#1 . . . . . So on and so on. So far, I've toyed with array_unique(), as well as multi-dimensional arrays, but I'm really not sure if this is the right approach. I'd post code but I'm not sure there's any point, what I'm really looking to find out is the method to use, rather than code snippets, so if anyone has achieved this, how did you do it? I'm happy as to teach myself whatever I need to know, problem is I don't know what I need to know...
Dynamic Menu Bar In A Frame - Controlling Frames In Php?
I have been using in a lot of websites a script that creates a menu bar but avoids that the button to the current page can be clicked. I am rather satisfied with it (although suggestions for better ways of doing things are welcome, the script follows below FYI) No there is a a problem that for a new site (www.orkestbasic.nl/nieuw) the menu with the links has to be placed in a separate frame because the right part of the page must be scrollable. So the check wether a button has to be a link or not cannot be done anymore with checking PHP_SELF as I am used to do. I am thinking of making all the links to something like <a href = "main.php?content=songlist"> then main.php would be a frameset with something like <frame name = "content" src = "<?php echo "$content.php"?>"> In the left frame I could do a similar thing with a small modification to the createlink function (see below) I often use. But I would like to know if there are more elegant suggestions for it. Could not find really good tips on google. Thanks for any help FYI This is the function I have been using until now. function mvwMaakLink($omschrijving, $verwijzing, $separator = "", $aHrefClass = "", $noHrefClass = "") { $locatie = $_SERVER['PHP_SELF']; //link to the current page, no need for clicking on it //echo $locatie; if (strstr($locatie, $omschrijving)) { $beginTag = ""; $slotTag = ""; if ($noHrefClass != "") { $beginTag = "<span class = "$noHrefClass">"; $slotTag = "</span>"; } echo "$beginTag$verwijzing$slotTag"; } else { $beginTag = "<a "; if ($aHrefClass != "") { $beginTag .= "class = "$aHrefClass" "; } $beginTag .= "href = "$omschrijving">"; echo("$beginTag$verwijzing</a>$separator"); } }
Unexpected Order On Dynamic Select Menu
I've got a directory called 'potm' (picture of the month) that contains: 02.jpg 03.jpg 04.jpg I'm dynamically constructing an 'archive' select menu that contains all the available pics. For some reason the select menu reads: April February March I've tried to sort the array, but it made no difference. PHP Code:
Mysql / Dropdown Menu
what i am trying to do is to make a system with a few input pages and edit and read pages.. so right now i got the input/edit/read pages working. (yay) But now I want to have on 1 input page a dropdown menu that reads its information from the database. and that if i go to the page i can select a value out of the db and submit that inside my form and that it reminds the value if i view or edit the page. So what i got now is a little system that is able to add/remove/edit a value inside a field called "drop01" Well now i got a other input page called "input01.php" inside this script i want to have the dropdown menu that reads its values from the "drop01" field. PHP Code:
[PEAR:QuickForm] Dynamically Change A Dropdown Menu According To Another Menu?
I've been using QuickForm for a few months now and I am now given a new challenge: I've got a search form with a dozen of dropdown menus, the first dropdown menu being "Brand". If you select either Brand A, B, C, D... Z, the second dropdown menu "Model" must be dynamically changed to model AA, AB, AC, AD..., according to the models manufactured by the brand selected in the first box. I've seen that done on quite a few sites, but never found if QuickForm had a quick & clean way of doing that.
MySQL Sorting
I'd like to do is divide results from a MySQL query over multiple pages, each holding a certain number of results. Now I have a PHP script that uses the MySQL command LIMIT in the query to get # results at a time (which also means not all the results are returned every time, just a few, obviously this is a good thing for speed/load so I wanna keep it that way). The MySQL manual states that if you use LIMIT # with ORDER BY, MySQL will end the sorting as soon as it has found the first # lines Ok I could've posted this on the MySQL forum first but actually I was wondering whether someone has a solution in PHP for this?
Select List/Menu Using PHP And MYSQL
Here is my code: <select name="country" class="sidelinks"> <?php do { ?> <option value="<?php echo $row_AllCountries['country_ID']." ";?>"<?php if ($row_AllCountries['country_ID'] = $acountry) { echo "selected"; }?> > <?php echo $row_AllCountries['countryname'];?></option> <?php } while ($row_AllCountries = mysql_fetch_assoc($AllCountries)); ?> </select> A few words to describe: -$row_AllCountries['country_ID'](get from MySQL) is a unique country ID number -$row_AllCountries['countryname'](get from MySQL) is the name of the country -$acountry is the country ID number that i want to be selected when the form loads I have all the values and country names named OK...the only problem is that when the form loads it selects the last country.
MySQL Database In A Pulldown Menu
I have a script that I am trying run with PHP, that gets the contents of a database, and then arrange them in a pulldown menu. I then have that selected Name, for instance, and then I can choose between 2 Buttons. Edit and Delete. PHP Code:
Populating DHTML Menu From MySQL
I have a client that would like to have drop down menus added to a nav bar that is generated from MySQL. Is it possible to have a dynamically driven DHTML menu from MySQL?
Mysql Fetch With Drop Down Menu
Im trying to do somekind of dropdown menu taking information from the database but im not quite sure how this could be done with my knowledge. alright so lets say i have a table named: projects SELECT name FROM project. and it will put all the data found in a html drop down menu?
PHP/MySql Sorting Difficulties
I have written a sorting engine which displays non expired records, but im having difficulties getting it to work. It was working fine until I added pagination, and now it seems to have gone to pot. The script works by getting todays date, and based on the users selection from the drop down menu, calculates the number of pages, and records the users sort preference. The correct number of links to different pages are then generated, and the pages are populated based on the users sort preference, or so I thought... The first page of results is sorted correctly, but on the second and subsequent pages, this isnt always the case. This causes results to be appearing in the wrong order, or not at all in some cases. Ive included my source code, if anyone see's anything which is glaringly obvious, or feels like giving me a hand fixing this id very much appreciate it :) <!-- This is the HTML Form where the user selects if they wish to sort or search for records --> .......
MySQL (DB) Result Sorting
I'm doing is taking results (fetching rows) from my mySQL database. But what I want to do is sort the results according to last name. So basically the table structure looks something like this: id (primary key) fullname A example rows could be: 1 John Smith 2 Mary Jane Now what I want to do is sort the results in PHP based on last name. I'm using the Pear DB for connecting to my mySQL database. Based on the example rows I gave, Mary Jane would go first, and then John Smith. How would I go about doing this? I was beginning to split the result based on spaces, and the last word to explode, but how would I truly do this?
MySQL Query Sorting
I was curious if there is a way to sort out duplicates in data returned by an query. I have a database, basically a mailing list database and when I query the database for the emails addresses, I get the returns echoed to the page as expected, but it looks like some people have signed up multiple times. So I have duplicates in my echoed list. Is there a way to have the data sort so the duplicates do not appear, and the email will only appear once on the list? I don't want people to be getting 5 of the same emails from me.
Simple Menu, MySQL Query Question
I'm creating simple menu. MySQL: +----+-----+----------------------+ | id | sid | Title | +----+-----+----------------------+ | 1 | 0 | Main Menu 1 | 2 | 0 | Main Menu 2 | 3 | 1 | SubMenu 1 of menu 1 | 4 | 1 | SubMenu 2 of menu 1 | 5 | 1 | SubMenu 3 of menu 1 | 6 | 2 | SubMenu 1 of menu 2 +----+-----+---------------------- What should be my query? I'm trying to select all titles, and display them: Main Menu 1 - SubMenu 1 of menu 1 - SubMenu 2 of menu 1 - SubMenu 3 of menu 1 Main Menu 2 - SubMenu 1 of menu 2
Paginating And Data Sorting With Php/mySQL
I have a main menu full of information which is paginated 20 records per page. I'm trying to make the query so that the user can sort the data by links located at the top of the page. "What's My Problem?" - It works, when I select the link it sorts by whatever I have selected as I want but... The Problem - It only sorts one page and doesn't continue on, when I click page two the values are reset. This is a new operation to me so if anyone could offer a suggestion I'd appreciate it. The Question - How do I sort paginated data and make it so the data stays sorted throughout the 20 or so pages?
Sorting Arrays Retrieved From A MySQL Db
I am trying to make a news system. I have done it, but the news are listed with the last on at the bottom. This makes it kind of troublesome to read the latest news when you enter the site and there are a lot of news items, cause you would have to scroll down. PHP Code:
Listing/Sorting MySQL Output
I have a page that gets a list of magazine article titles stored in a MySQL database. The output is sorted and formatted all nicey nice. I am wondering if there is an easy way, or some trick, that I can use to place headings in between the category listings for the articles. Allow me to explain. Let's say there are 15 articles 5 of them are category A; five of them are category B; the last five are category C. Right now I am sorting them fine. With one database call can I insert an image or text header (and possibly an <a href>) between A and B to denote the next category? I can do it with several database queries, but I'd like to avoid that if possible.
Sorting A Table Into An Array In Mysql
Can someone tell me how to sort a table using a while function. This is what i want to do. I have table that has 17 fields, the first two are id and date and the rest of date..but what i want to do is take the data and sort it by the date and put the rest of the data under that date. example: date Data date Data I asume the array will look like this result[0][0] result[0][1] result[1][0] result[1][1] and so on .....
Drop Down Menu Where The Items Are From A MySQL Select Query
I am just starting programming in PHP and wonder if it is possible to have a drop down menu where the items are from a MySQL select query. I am registering people for a weekend seminar and want to have a list of valid weekends to choose from on the form. Any pointers to scripts or PHP references that will help would be appreciated. I am using the book "Build your Own Database Driven Website Using PHP & MySQL" to get me started, but also need recommendations for a general primer to php.
Search Drop Down Menu To Choose Mysql Table
I have currently made a simple PHP search script which, when data is entered in a text box and it's submitted, it queries a table in a MYSQL database and returns information. This works. However, I want to have a combo box beside the text box with options to query different tables depending on which item in the combo is selected. At the moment it searches a news articles table by content and title. But I want to adapt the script so that it searches another table which holds information on people for example. It currently gets the item from the text box with the code:
Mysql Dynamic Combo Box
i want to have a combo box that is populated by certain filelds of a mysql table. how is this done using mysql, php. i saw some other posts about using, javascript. must i? the table that it is calling from isn't updated very often. also, one other note. i want 4 columns of the table represented in the 1 drop down box, so that users have a more specific description of the row they are selecting.
Dynamic Checkboxes From Mysql Table
tearing my hair out over this! I have 2 tables: PTable which lists all traits pid,ptype 1,good 2,bad 3,neutral UserP Table which records user and traits uid,pid 1,2 1,3 9,1 9,2 9,3 For a certain user UID, how can I get php to automatically create html checkboxes listing ALL traits from PTable and check each trait based on the UserP table on a webpage? Hence, if UID is 1 it should show good - unchecked bad - checked neutral - checked
Dynamic Drop Down Boxes With Mysql
I'm working on a database project for a class and am having problems populating select boxes with a field from a mysql table. The first thing that I'm trying to do is pull the field LastName from the table Faculty. Then when the user selects the faculty member in the drop down box, it will then display all of the fields related to that faculty member...first and last name, title, office number etc and allow the user to edit those fields and then resubmit them to the database. However I can't seem to get the drop down box to populate, so if anyone has any suggestions as to how to fix this I would love to hear them. Code:
Dynamic List Populated By MySQL Table
I am building my first php page and I've ran into problems trying to create a dynamic drop down list for an INSERT page. My page is based on this example from mysql.com. I want to populate the list from a table in MySQL, but when I test the page the list only contains the first record. If anyone can help me out, or recommend an easy way to create dynamic menus/lists, I will be very grateful. This code appears above the FORM ACTION: $NearMajorCity = mysql_query("SELECT NearMajorCity_ID, NearMajorCity FROM NearMajorCity"); This code is within the FORM: <SELECT NAME="NearMajorCity" SIZE=1> <OPTION SELECTED VALUE="">Select One <OPTION VALUE="">--------- <?php while ($NearMajorCity = mysql_fetch_array($NearMajorCity)) { $NearMajorCity_ID = $NearMajorCity["NearMajorCity_ID"]; $NearMajorCity = $NearMajorCity["NearMajorCity"]; echo("<OPTION VALUE='$NearMajorCity_ID'>$NearMajorCity "); } ?> </SELECT> I want to be able to view the names of the Major Cities in the list, but I want the NearMajorCity_ID inserted into the table.
Phpmyadmin/MySQL - Dynamic Date Field?
I am a relative newbie for php/MySQL, and most of what I am doing is based on being self-taught using someone else's well-written code, and my own googling the answers to my questions. I'm doing a php/MySQL page that reads data out of a MySQL database. Longer term, I'll do a data-entry screen allowing me to modify the database or add new records. For now, I'm just using phpmyadmin to data enter stuff. Is there a way to set up a date field, Last_Update, that would automatically update to today's date any time a record was added or changed using phpmyadmin? Not sure if I'm asking the question clearly. What I want would be that, let's say that I add a new record today, April 23. The Last_Update field for the record would automatically be April 23. If I go in and modify and part of that record on April 29, Last_Update automatically changes to April 29 for that record. If that's not possible, then how in php/MySQL would I display on a web page "Information last updated on mm/dd/yyyy" based on the contents of the database?
Dynamic Photo Gallery Based On Mysql Database
I would like to turn my attention to using PHP to organize hundreds of images on my site. I would appreciate some direction. I have in mind putting the image names in a database and will use those names to create links, likely output as a table or drop down menus in a form. I specifically wonder if there is any way to "dynamically" create thumbnails in PHP from the full image? Alternately, are there any programs out there for "batch creation" of thumbnails?
Getting Another Menu
how can I do to create another menu with the results from the options they choose? For example, they are looking for their grades so they choose in a first menu the carreer, in other menu the grade, and then when they finish choosing the grade, It appear automaticaly in other menu all the names of the subjects concerned to te carreer and grade given.
Php Menu
How do I have The menu and the context information display at the same time? Code:
Populate One Menu From Another
I thought this would be simple and there would be advice / tutorials everywhere for this, but now that I'm working on it, I can't find any reference except for ASP or Javascript code. PHP/MySQL - 3 form select menus: Project, Categories, Subcategories. When a Project is selected, the Categories list is populated based on Project selected, then Subcategories list is populated based on Category selected. I see this all over the Net, but through 10 books, there isn't anything specific. I think I get lost with some of PHP structure since I've been using DW - I end up editing most of it in order to follow it, but DW works pretty good for getting initial testing done. I just can't seem to find further guidance on this. So far I have:
Drop Down Menu(add Cat)
I have DB to add category and forum to edit the terms that in the cat so I add this code in the edit forum to change the cat of the term by choose the cat from drop down menu PHP Code:
Collapsing Menu
I have written the code to do this however I am completely at a loss to do one particular thing. To best explain what the problem is I will give you an overview of how the menu hangs together. The menu looks like this:
Menu-submenu
I've to create a simple site with menu-submenu. The submenu are shown in a "dropdown" object that use "<ul><li>".... Here is the structure: group1 menu1 menu2 group2 menu1 menu2 menu3 ..... by selecting the link group1, group1->menu1, group1->menu2 I'd like on a left pane the submenus structure of the group1, but not the substructure of the menu2 etc. What's the simple way to create it ? I'd like to modify only once and have this working on all my site (I use a simple template using a table).
Dropdown Menu
I want to upload a feild values into a dropdownmenu. can anyone help me how to write in php code.
Drop Down Menu
I have a page that uses php to look up specific fields in a specific table of a specific database based on the username. Using this, it creates a dropdown list of information belonging to that user. The fields in question each have 13 pieces of data. Based on what they click in the dropdown box, I need that specific data to pass onto hidden fields on the page. Code:
Drop Down Menu
I'm struggling to get this to work. It is suppose to show only $name and not $name and $email PHP Code:
Drop Down Menu
I am implementing a website with dreamweaver. I dont know much about programming but I can handle scripts and manupilate. does anyone know a website that i can get a free drop down menu script to use on the website's navigation?
Template Menu
I'm trying to decide witch way to do my menu for my program.... see some menu will be accessed by certain users with certain power... but i cant seem to decide with way to do it because... the menu is also template based ( $template = new template( menu.shtml )) anyone has done this in a way to keep the template system integrated and only show certain menus according to there users prv?
Drop Down Menu
I have 2 drop down boxes on my site. I want the selection of the first one to populate the second box.
Drop Down Menu
What i would like to do is look in a file and see what the name's of the files are in there and have them put in to a drop down menu. Dose some one know of a tutorial on this or how to do it?
Drop Down Menu
I have a problem with a drop down menu, I have 2 drop down menu's if 1 select in dropdown menu 1 a catagorie then I must give this to menu 2 and then there must be things in menu to with catagorie from menu 1 I just want when I clicked menu 1 the php file refreshed en gives the catagorie with the refreshed file but HOW?
Menu/submenu
I wish to make a menu (in php), and every time a menu-item is selected, a sub-menu will be visible.
Triple Menu
I'm going to have a website that will have a very dynamic menu structure (one that could change every few minutes) and it is essential that everytime the menu is built, the updated database entries are included. Background: The site is a homework study site that gives study tools, etc. So lets say that i want to look up the Math (subject or "class"), Pre-Algebra ("course"), CPM ("curriculum"), i would first select Math in the first drop down menu, then Pre-Algebra in the second, and then CPM in the third. In the second and Third boxes however, there will be other courses and curriculums to choose from. Those will be updated very regularly and i do not want to do this manually. Code:
|