Connecting Tech Pros Worldwide Help | Site Map

PHP - Dynamic Drop Down Menu

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 6th, 2006, 09:01 PM
Newbie
 
Join Date: Mar 2006
Posts: 12
Default PHP - Dynamic Drop Down Menu

Hi,

I'm fairly new to PHP and I've created a dynamic drop down menu that populates itself with data from a MySQL table. What I would like to do is create a non dynamic drop down menu that alters what is shown in the dynamic menu.

For example, the first menu has three cities London, Paris, New York. If I choose London it populates the second menu with people from London.

Here is the code I have for my dynamic menu

Expand|Select|Wrap|Line Numbers
  1. <td valign=top><strong>Name:</strong></td>
  2.     <td>
  3.     <?php
  4.     echo "<select name=\"name\">"; 
  5.     echo "<option size =30 selected>Select</option>";
  6.     if(mysql_num_rows($sql_result)) 
  7.     { 
  8.     while($row = mysql_fetch_assoc($sql_result)) 
  9.     { 
  10.     echo "<option>$row[name]</option>"; 
  11.     } 
  12.  
  13.     } 
  14.     else {
  15.     echo "<option>No Names Present</option>";  
  16.     } 
  17.     ?>
  18.     </td>
  19.     </tr>    
  20.  
So basically, I need a standard menu, i.e:

Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.     <td valign=top><strong>Sites:</strong></td>
  3.     <td> <select name="cities">
  4.     <option selected>Select</option>
  5.     <option>London</option>
  6.     <option>Paris</option>
  7.     <option>New York</option>
  8.     </select>
  9.     </tr>
  10.     </td>
  11.  
I think I need to hold the value of cities when selected in a variable and create an if statement with various sql query results to be run depending on what option is chosen.

Any help would be highly appreciated!

Thanks,
Mart

Last edited by mart2006; March 6th, 2006 at 09:04 PM.
Reply
  #2  
Old March 7th, 2006, 11:35 AM
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 5,731
Default

I think you may have forgotten or not understood that PHP runs of the server and the implications of this.

PHP runs on the server as you request a page returning the required output. This output may be obtained from a MySql database or any other sourse that PHP can access.

What this means though is that if you want to generate source using PHP you have to make a server request of some sort.

In practive this means for a simple page either reloading the current or a new page or loading a page in an IFRAME.

However I get the impression that you want to have a single page with 2 selection boxes on it and fill one depending on what the selection in the other is.

It is possible (I have never done it) using XML requests to reload content in a div without reloading the rest of the page using code that looks something like

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. /***********************************************
  4. * Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
  5. * This notice MUST stay intact for legal use
  6. * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
  7. ***********************************************/
  8.  
  9. var loadedobjects=""
  10. var rootdomain="http://"+window.location.hostname
  11.  
  12. function ajaxpage(url, containerid){
  13.   var page_request = false
  14.  
  15.   if (window.XMLHttpRequest) // if Mozilla, Safari etc
  16.     page_request = new XMLHttpRequest()
  17.   else if (window.ActiveXObject){ // if IE
  18.     try {
  19.       page_request = new ActiveXObject("Msxml2.XMLHTTP")
  20.     } 
  21.     catch (e){
  22.       try{
  23.         page_request = new ActiveXObject("Microsoft.XMLHTTP")
  24.       }
  25.       catch (e){}
  26.     }
  27.   }
  28.   else
  29.     return false
  30.  
  31.   page_request.onreadystatechange=function(){
  32.     loadpage(page_request, containerid)
  33.   }
  34.  
  35.   page_request.open('GET', url, true)
  36.   page_request.send(null)
  37. }
  38.  
  39. function loadpage(page_request, containerid){
  40.   if (page_request.readyState == 4 
  41.   && (page_request.status==200 || window.location.href.indexOf("http")==-1))
  42.     document.getElementById(containerid).innerHTML=page_request.responseText
  43. }
  44.  
  45. function loadobjs(){
  46.   if (!document.getElementById)
  47.     return
  48.  
  49.   for (i=0; i<arguments.length; i++){
  50.     var file=arguments[i]
  51.     var fileref=""
  52.  
  53.     if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
  54.       if (file.indexOf(".js")!=-1){ //If object is a js file
  55.         fileref=document.createElement('script')
  56.         fileref.setAttribute("type","text/javascript");
  57.         fileref.setAttribute("src", file);
  58.       }
  59.       else if (file.indexOf(".css")!=-1){ //If object is a css file
  60.         fileref=document.createElement("link")
  61.         fileref.setAttribute("rel", "stylesheet");
  62.         fileref.setAttribute("type", "text/css");
  63.         fileref.setAttribute("href", file);
  64.       }
  65.     }
  66.  
  67.     if (fileref!=""){
  68.       document.getElementsByTagName("head").item(0).appendChild(fileref)
  69.       loadedobjects+=file+" " //Remember this object as being already added to page
  70.     }
  71.   }
  72. }
  73.  
  74. </script>
  75.  
As you can probably telll from the header I got this code from http://www.dynamicdrive.com/dynamici...jaxcontent.htm


An alternitive method to use if the is only a small amount of data involved is to use PHP to write some Javascript that defines variables containing all the data (a 2 dimensional array of cities and names would do it). However I would only recomend doing this for a reasonable small amount of data.
Reply
  #3  
Old August 28th, 2006, 11:25 AM
Newbie
 
Join Date: Jul 2006
Posts: 4
Default

I have to create a 4drop down menus in starting only first drop down menu is having list rest three are blank then after i select first drop down value then next drop down menu have there corresponding values then third drop down will have there values then fourth ..
How will i do this i need in PHP or Javascript.
aman
Reply
  #4  
Old August 28th, 2006, 11:28 AM
Newbie
 
Join Date: Jul 2006
Posts: 4
Default

Dynamic Drop Down Menu
Reply
  #5  
Old August 28th, 2006, 12:57 PM
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 5,731
Default

Well you only need PHP if the data is being sourced from a database or some other server based location (a file).

When I list selection is made you will either need to reload the page with the new information or have already got all the information in the page and only display the relevent options. This will require javascript.
Reply
  #6  
Old July 30th, 2007, 12:24 AM
Newbie
 
Join Date: Jul 2007
Posts: 2
Default

Quote:
Originally Posted by mart2006
Hi,

I'm fairly new to PHP and I've created a dynamic drop down menu that populates itself with data from a MySQL table. What I would like to do is create a non dynamic drop down menu that alters what is shown in the dynamic menu.

For example, the first menu has three cities London, Paris, New York. If I choose London it populates the second menu with people from London.

Here is the code I have for my dynamic menu

Expand|Select|Wrap|Line Numbers
  1. <td valign=top><strong>Name:</strong></td>
  2.     <td>
  3.     <?php
  4.     echo "<select name=\"name\">"; 
  5.     echo "<option size =30 selected>Select</option>";
  6.     if(mysql_num_rows($sql_result)) 
  7.     { 
  8.     while($row = mysql_fetch_assoc($sql_result)) 
  9.     { 
  10.     echo "<option>$row[name]</option>"; 
  11.     } 
  12.  
  13.     } 
  14.     else {
  15.     echo "<option>No Names Present</option>";  
  16.     } 
  17.     ?>
  18.     </td>
  19.     </tr>    
  20.  
So basically, I need a standard menu, i.e:

Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.     <td valign=top><strong>Sites:</strong></td>
  3.     <td> <select name="cities">
  4.     <option selected>Select</option>
  5.     <option>London</option>
  6.     <option>Paris</option>
  7.     <option>New York</option>
  8.     </select>
  9.     </tr>
  10.     </td>
  11.  
I think I need to hold the value of cities when selected in a variable and create an if statement with various sql query results to be run depending on what option is chosen.

Any help would be highly appreciated!

Thanks,
Mart


Hey Mart,

I've recently done the same thing. What ever you name your select box will the name of the POSTED value of the drop down. i.e.
<select name="city">
<option>London</option>
<option>Paris</option>
<option>New York</option>
</select>

You would have a table for each city which would contain a list of users you would then submit that to some PHP code that would include something to the effect of ...

<?php $city=$_POST['city'];
//construct lookup statementins

$sql="select people from $city where city= '$city'";

$result=mysql_query($sql,$conn) or die (mysql_error());

if(mysql_num_rows($result)) {
while($row = mysql_fetch_row($result))
{

print("<option value=\"$row[0]\">$row[0]</option>");
}
}
else {
print("<option value=\"\">No courses created yet</option>");
}

?>

That'll work of coruse you don't mind reloading the page. This also will not take care of duplicate names that you may have in the DB.
Reply
  #7  
Old July 30th, 2007, 02:20 PM
nathj's Avatar
Expert
 
Join Date: May 2007
Location: North Tyneside
Posts: 852
Default

Hi,

It is possible to achieve exactly what uuo are after using a combination of HTML, PHP, MySQL and JavaScript.

First the data structure - as this will be vital.

From what I ahev read on this thread for this idea you need three tables:
1) The Cities
2) The people
3) The link/association between the two

This is a standarad structure for potential many-to many data relationships. It works perfectly and is properly normalised.

Second the HTML - this is just a form, the combo box of cities, which can be populated from the database, should have an onchange that calls a javascript.

Third the JavaScript - this uses XMLHTTPREQUEST to get the data from the database via the Fourth and final item - the PHP.

This structure works a treat, I'm using on a site that is testing at the moment.

Have a read of the PHP AJAX tutorial from W3Schools and have a go.

If you get stuck post the problem back here.

I hope this points you in the right direction. But it is definitley possible to have the page refresh as you are on it.

Cheers
nathj
Reply
  #8  
Old August 2nd, 2007, 08:32 PM
Newbie
 
Join Date: Aug 2007
Posts: 26
Default

Quote:
Originally Posted by nathj
Hi,

It is possible to achieve exactly what uuo are after using a combination of HTML, PHP, MySQL and JavaScript.

First the data structure - as this will be vital.

From what I ahev read on this thread for this idea you need three tables:
1) The Cities
2) The people
3) The link/association between the two

This is a standarad structure for potential many-to many data relationships. It works perfectly and is properly normalised.

Second the HTML - this is just a form, the combo box of cities, which can be populated from the database, should have an onchange that calls a javascript.

Third the JavaScript - this uses XMLHTTPREQUEST to get the data from the database via the Fourth and final item - the PHP.

This structure works a treat, I'm using on a site that is testing at the moment.

Have a read of the PHP AJAX tutorial from W3Schools and have a go.

If you get stuck post the problem back here.

I hope this points you in the right direction. But it is definitley possible to have the page refresh as you are on it.

Cheers
nathj
Thanks for this - I have had a similar problem in populating a second select menu from the first, where both lists are generated from mySQL. Your suggestion works in FF, Safari and Opera very well, but in IE the select menu which is meant to be repopulated remains blank.

I have tested the database, php page and js file, and all of these seem to work. The problem is in populating the <select> tag using the .innerHTML command (it repopulates a div tag without any problem). My code is as follows:

HTML file:
Expand|Select|Wrap|Line Numbers
  1. <select name="supervisor" id="supervisor">
  2.             <option value="none">please select...</option>
  3.           </select> 
  4.  
js command:
Expand|Select|Wrap|Line Numbers
  1. function stateChanged() 
  2. if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  3.  { 
  4.  document.getElementById("supervisor").innerHTML=xmlHttp.responseText 
  5.  } 
  6. }
  7.  
php:
Expand|Select|Wrap|Line Numbers
  1. do { 
  2.  
  3.        echo  "<option value=\"";
  4.         echo $row_rs_subsup['firstName']; echo " "; echo $row_rs_subsup['lastName']; 
  5.         echo "\">"; echo $row_rs_subsup['firstName']; echo " "; echo $row_rs_subsup['lastName']; 
  6.         echo "</option>\n"; 
  7.  
  8.           }  while ($row_rs_subsup = mysql_fetch_assoc($rs_subsup));
  9.  
I have tried a number of ways to get around this (e.g. playing with the js command), but I haven't really got anywhere - any suggestions would be greatly appreciated.
Reply
  #9  
Old August 3rd, 2007, 06:31 AM
nathj's Avatar
Expert
 
Join Date: May 2007
Location: North Tyneside
Posts: 852
Default

If IE will re-populate a div tag no problem then how about doing that. So when the seonc dropdown is populated you actually re-create it?

It's a bit crazy I know but it should still work on the other browsers as well.

Cheers
nathj
Reply
  #10  
Old August 3rd, 2007, 09:47 AM
Newbie
 
Join Date: Aug 2007
Posts: 26
Default

Yes, it's now working, finally ending a long struggle - thanks a lot!!



The whole select menu is wrapped in a div tag, and with the php code amended as follows:

Expand|Select|Wrap|Line Numbers
  1. echo "<select name=\"supervisor\" id=\"supervisor\">\n";
  2. echo "<option value=\"none\">please select...</option>\n";
  3.  
  4. do { 
  5.  
  6.  
  7.       echo  "<option value=\"";
  8.         echo $row_rs_subsup['firstName']; echo " "; echo $row_rs_subsup['lastName']; 
  9.         echo "\">"; echo $row_rs_subsup['firstName']; echo " "; echo $row_rs_subsup['lastName']; 
  10.         echo "</option>\n"; 
  11.  
  12.           }  while ($row_rs_subsup = mysql_fetch_assoc($rs_subsup));
  13.  
  14.  echo "</select>"; 
Reply
  #11  
Old August 3rd, 2007, 09:50 AM
nathj's Avatar
Expert
 
Join Date: May 2007
Location: North Tyneside
Posts: 852
Default

Quote:
Originally Posted by erp23
Yes, it's now working, finally ending a long struggle - thanks a lot!!



The whole select menu is wrapped in a div tag, and with the php code amended as follows:

Expand|Select|Wrap|Line Numbers
  1. echo "<select name=\"supervisor\" id=\"supervisor\">\n";
  2. echo "<option value=\"none\">please select...</option>\n";
  3.  
  4. do { 
  5.  
  6.  
  7.      echo "<option value=\"";
  8.      echo $row_rs_subsup['firstName']; echo " "; echo $row_rs_subsup['lastName']; 
  9.         echo "\">"; echo $row_rs_subsup['firstName']; echo " "; echo $row_rs_subsup['lastName']; 
  10.         echo "</option>\n"; 
  11.  
  12.          } while ($row_rs_subsup = mysql_fetch_assoc($rs_subsup));
  13.  
  14. echo "</select>"; 
I'm glad it's got sorted.

All the best with the rest of the project.

Cheers
nathj
Reply
  #12  
Old November 5th, 2007, 01:36 PM
Newbie
 
Join Date: Nov 2007
Posts: 1
Default

Hi erp23,
could you send me the entire code for these menus? I'm new to PHP and need to create a 3 -field menu derived from 3 DB dependent tables
Thanks in advance
Reply
  #13  
Old November 12th, 2007, 02:26 AM
Newbie
 
Join Date: Nov 2007
Posts: 1
Default

Hi:

could you email me the code for these menus to, I need the same thing and I've been racking my brain over it for days now...

Richard

<email Removed-Moderator>

Last edited by ajaxrand; November 26th, 2007 at 01:22 AM. Reason: email removed
Reply
  #14  
Old November 23rd, 2007, 08:56 AM
Newbie
 
Join Date: Nov 2007
Posts: 1
Default

would the following code work if say i had one simple database 'mp3 players'

and the 1st select box has been hard coded to have 3 manufacturers held within it, after selecting the 1st select the next one is generated from that just getting the name of the items i.e. 1select APPLE 2nd select gets things such as ipod nano, ipod touch etc, the examples above all seem to use multiple databases.

basically just wondering if it could be implemented on a single database??

thanks

dan
Reply
  #15  
Old November 26th, 2007, 09:26 PM
Newbie
 
Join Date: Nov 2007
Posts: 1
Default

I also need the same code thing.
I'm totally new to PHP. I'm trying to create a new field in member profile for a IBP forum without using Custom Profile Field.
Reply
  #16  
Old December 3rd, 2007, 10:24 AM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default

would anyone send me an example code for drop down menus???at least 3 drop down???just an example???thanks
Reply
  #17  
Old December 3rd, 2007, 10:29 AM
Newbie
 
Join Date: Dec 2007
Posts: 7
Default

could you send me the entire code for these menus? I'm new to PHP and need to create a 3 -field menu derived from 3 DB dependent tables
Thanks
Reply
  #18  
Old October 17th, 2008, 02:23 PM
Newbie
 
Join Date: Apr 2006
Posts: 3
Default

I am pasting some code here in case you wanted to see how you can use database items to create a Drop Down Menu instead of a Drop Down List. The menu uses CSS to show/hide elements.

Please note the database used in the example is not MySQL but txt-db-api, which is a text-file database available for php.




<?//horizontal menu bar ************************************************** ***************
$rs1=$db->executeQuery("SELECT * FROM sch_pages WHERE p_parpage=0 ORDER BY p_order");
while($rs1->next())
{
list($p_id, $p_name, $p_sysname, $p_order, $p_prot, $p_pass, $p_nomenu, $p_coded, $p_https, $p_parpage)=$rs1->getCurrentValues();
if($p_nomenu==0)
{
?>


<ul id="nav">
<li><a HREF="index.php?sch_action=display_content&c_page= <?echo $p_id?>"><? echo $p_name ?></a>
<ul>


<?//drop down submenu bar ************************************************** *************
$rs2=$db->executeQuery("SELECT * FROM sch_pages WHERE p_parpage=$p_id ORDER BY p_order");
while($rs2->next())
{
list($p_id, $p_name, $p_sysname, $p_order, $p_prot, $p_pass, $p_nomenu, $p_coded, $p_https, $p_parpage)=$rs2->getCurrentValues();
if($p_nomenu==0){?>
<li><a HREF="index.php?sch_action=display_content&c_page= <?echo $p_id?>"><? echo $p_name ?></a></li>
<?}
}
?>


</ul>
</li>
</ul>


<?
}
}
?>




<script>
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagNam e("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>




<style>
#nav, #nav ul {
padding: 0;
margin: 0;
list-style: none;
}
#nav a {
display: block;
width: 10em;
}
#nav li {
float: left;
width: 10em;
}
#nav li ul {
position: absolute;
width: 10em;
left: -999em;
}
#nav li:hover ul {
left: auto;
}
#nav li:hover ul, #nav li.sfhover ul {
left: auto;
}
</style>
Reply
  #19  
Old October 21st, 2008, 03:55 AM
Newbie
 
Join Date: Oct 2008
Posts: 1
Default

source

iPod is arguably one of the coolest devices ever created. If you have an iPod, you know what wonders those little machines perform supporting music, video and pictures. What could be better than pulling out your iPod to watch a few clips from the Internet when you' re bored on the road or if you have extra time between classes? DVD to iPod Software helps you convert DVD you' ve downloaded or uploaded to your iPod. Now I will help you make an informed decision on which DVD to iPod Software is right for you.



1 | iPod Video Converter + DVD to iPod Suite


It is an all-in-one iPod video Conversion solution. It includes 2 software -- " iPod Video Converter" and " DVD to iPod Converter". It supports almost all kinds of DVD formats to iPod Movie / iPod Video format (MP4 format) and DVD to VCD/SVCD conversion. It direct convert DVD to iPod so its conversion speed is far faster than others.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 9 | Ease of Use: 8. 5 | Speed of Conversion: 8. 5
UI skin: 8 | Reviewer Rating: 8. 5 | Popularity: 8. 5
Download Now

2 | Avex DVD to iPod Video Suite


It is a One-click, All-in-One solution to create iPod movies from DVDs, TV shows and home Videos. It combines DVD to iPod Converter and iPod Video Converter in one package.It features fast conversion speed, superb Video/Audio quality. And it's easy to use!
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 8. 5 | Ease of Use: 8. 5 | Speed of Conversion: 8
UI skin: 8. 5 | Reviewer Rating: 8 | Popularity: 8
Download Now


3 | PQ DVD to iPod Video Suite


This suite provides a One-Click, All-In-One solution to convert DVD, Tivo, DivX, MPEG, WMV, AVI, RealMedia and many more to iPod Video. It support MPEG-4 and H.264 with high video quality plus advanced video editing features. Its DVD conversion speed is super fast ( up to 400%).
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 8 | Ease of Use: 8 | Speed of Conversion: 8
UI skin: 8 | Reviewer Rating: 7. 5 | Popularity: 7. 5
Download Now


4 | Accelerate DVD to iPod Converter


It is the fastest DVD movie to iPod video converter software so far in the world. It can convert almost all kinds of DVD to iPod video (mp4) format. Its conversion speed is far faster than real-time, converting one DVD movie only takes half an hour in some high-end computers.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 7. 5 | Ease of Use: 7. 5 | Speed of Conversion: 8
UI skin: 7. 5 | Reviewer Rating: 7. 5 | Popularity: 7
Download Now


5 | Super DVD to iPod Converter


It is the easiest and the most powerful DVD to iPod Converter software. It can capture and convert any segment of a DVD movie to iPod mp4 format, select target subtitle and audio tracks.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 7. 5 | Ease of Use: 7. 5 | Speed of Conversion: 8
UI skin: 7. 5 | Reviewer Rating: 7 | Popularity: 7
Download Now


6 | Wondershare DVD to iPod Ripper

It is a powerful DVD Ripping software for Apple iPod video. It can easily convert all kinds of DVD to iPod video (mp4) format with highest conversion speed and excellent conversion quality. It is also an easy-to-use iPod converter.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 7. 5 | Ease of Use: 7. 5 | Speed of Conversion: 8
UI skin: 8 | Reviewer Rating: 7 | Popularity: 6. 5
Download Now


7 | Aimersoft DVD to iPod Converter

It can easily convert DVD to iPod MP4 Video (h.264) and iPod MP3 for iPod Touch/Nano/iPod/Classic. It embed a powerful free iPod Copy Manager that can directly transfer DVD to iPod without iTunes, It can also copy your music, movies and TV shows from iPod to computer for backup.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 7 | Ease of Use: 7 | Speed of Conversion: 7. 5
UI skin: 8 | Reviewer Rating: 6. 5 | Popularity: 6. 5
Download Now


8 | Wondershare DVD to iPod Suite for Mac

It is an excellent DVD to iPod conversion tool that is designed for Mac OS users to convert DVD to iPod touch, iPod classic, iPod nano and other iPod players. It provides you with various DVD editing functions such as DVD chapter and title selection, movie trimming, video joiner and so on.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 7 | Ease of Use: 7 | Speed of Conversion: 7
UI skin: 7. 5 | Reviewer Rating: 8 | Popularity: 6. 5
Download Now


9 | Aplus DVD to iPod Ripper

It convert DVD files to a format that iPod understands. It is more simply and easy to use. It just a few clicks will completes the task of ripping DVD movies.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 6. 5 | Ease of Use: 7 | Speed of Conversion: 6. 5
UI skin: 7 | Reviewer Rating: 6. 5 | Popularity: 6
Download Now


10 | iSkysoft DVD to iPod Suite for Mac

It can rip DVD to all sorts of video files and extract DVD audio to various audio files. It can also output video and audio files that can be perfectly played on most portable players.
The 10 Most DVD to iPod Software Reviews and Downloads | Posted 10/14/2008
Features Set: 8 | Ease of Use: 6. 5 | Speed of Conversion: 6
UI skin: 6. 5 | Reviewer Rating: 6 | Popularity: 5. 5
Download Now

source
Reply
  #20  
Old October 21st, 2008, 04:41 AM
Newbie
 
Join Date: Oct 2008
Posts: 16
Default

Hi moderator,

Sorry for OOT,
Is it allowed here to post some advertisements in the middle of discussion like above?

Thanks
Reply
  #21  
Old February 25th, 2009, 08:40 PM
Newbie
 
Join Date: Feb 2009
Posts: 1
Default Yes, it can...

Quote:
Originally Posted by didgy58 View Post
would the following code work if say i had one simple database 'mp3 players'

and the 1st select box has been hard coded to have 3 manufacturers held within it, after selecting the 1st select the next one is generated from that just getting the name of the items i.e. 1select APPLE 2nd select gets things such as ipod nano, ipod touch etc, the examples above all seem to use multiple databases.

basically just wondering if it could be implemented on a single database??

thanks

dan
While the previous posts aren't necessary referring to multiple databases, but more than likely multiple tables within a database. Neither is necessary based on your example. You can have one table in a database that has X number of fields. 3 fields in your example..1 for a unique identifier of the record (gid), 1 for the manufacturer (maker), and one for the model (model).

Then to avoid calling to the database all the time, I would essentially pull the entire database at one go, and populate it out to PHP arrays multi-dimensional arrays.

Of course depending on volume of data in the table, it may be smarter to do multiple queries to the database depending on selection. Given the relatively small number of players available on the market though, I wouldn't sacrifice the overhead of making the multiple calls.

Note** There are also many ways to work with internal arrays within PHP with the data, up to you to figure out which one is going to work best for your sitaution, whether you need one large mult-dimensional array, or a grouping of multiple types of arrays.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.