Results 1 to 7 of 7

Thread: Select to cascade ajax + mysql

  1. #1
    Join Date
    Jan 2010
    Posts
    49

    Select to cascade ajax + mysql

    I must make a search engine with 6 multi select box. The choice of the 1st impact on the proposals available in the 2nd and the choice affects the proposals in the 3rd etc...

    My problem is that I hope that by default the select box 6 offer all their options so that we can begin the selection cascading from any selection, not necessarily by the 1st.

    Lets say that my request is to Get Help to enable all select to display all their options, not only for the 1st, as in the example.

    In short how to cascade Ajax and MySql?

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Select to cascade ajax + mysql

    enable all select to display all their options
    during the initial generation of your page, simply supply the list with all possible values. That is, basically the same applications as those used in Ajax calls, but without the parameter retrieved from the list "before" (which restricts the choice of content already).

    But, there you may need to pay more attention to chains if your lists were empty by default: if a choice from the list L1 brings nothing for posters to see in the list L2? When the lists are empty by default and they remain empty after this election, we doubt the significance. But if the following list were already completed and she is, how to deduce that the previous choice did not correspond to anything?

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Select to cascade ajax + mysql

    If your description is correct, it's just impossible. In any case, if you want to keep maintaining the rule "The choice of the 1st impact on the proposals available in the 2nd etc. ...". This is not a question of language but of logic.

    Otherwise, effectively decoupling the lists and offer all the options from each list and then selecting an option from the list 1, change the items in the list 2 etc. ... Gasworks in perspective ..

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Select to cascade ajax + mysql

    Quote Originally Posted by Reegan View Post
    If your description is correct, it's just impossible. In any case, if you want to keep maintaining the rule "The choice of the 1st impact on the proposals available in the 2nd etc. ...". This is not a question of language but of logic.

    Otherwise, effectively decoupling the lists and offer all the options from each list and then selecting an option from the list 1, change the items in the list 2 etc. ... Gasworks in perspective ..
    Why "Impossible"?

    The rule is simply "Choosing from a list L affects the proposals available in the list L1 etc.."

    Everything is managed correctly, if operationally feasible, the default values (mostly) ...

    Whatever the number of lists, each of length than did the previous one (which serves as a filter) and next (on which she serves as a filter).

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Select to cascade ajax + mysql

    Example:
    The database table we use in this example looks like this


    PHP code will be:
    PHP Code:
    <?php
    $q
    =$_GET["q"];

    $con mysql_connect('localhost''peter''abc123');
    if (!
    $con)
      {
      die(
    'Could not connect: ' mysql_error());
      }

    mysql_select_db("ajax_demo"$con);

    $sql="SELECT * FROM user WHERE id = '".$q."'";

    $result mysql_query($sql);

    echo 
    "<table border='1'>
    <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
    <th>Hometown</th>
    <th>Job</th>
    </tr>"
    ;

    while(
    $row mysql_fetch_array($result))
      {
      echo 
    "<tr>";
      echo 
    "<td>" $row['FirstName'] . "</td>";
      echo 
    "<td>" $row['LastName'] . "</td>";
      echo 
    "<td>" $row['Age'] . "</td>";
      echo 
    "<td>" $row['Hometown'] . "</td>";
      echo 
    "<td>" $row['Job'] . "</td>";
      echo 
    "</tr>";
      }
    echo 
    "</table>";

    mysql_close($con);
    ?>
    Source: w3schools

  6. #6
    Join Date
    Oct 2010
    Location
    US
    Posts
    1

    Hello

    Just thought I should take a moment and say what's up to everybody. Looking forward to the site and what everyone here has to talk about.

  7. #7
    Join Date
    May 2009
    Posts
    1,611

    Re: Select to cascade ajax + mysql

    Welcome to Techarena forums friend.

    Wish you great time here.

Similar Threads

  1. Using Ajax to Retrieve Data from a MySQL Database
    By warthogweb in forum Software Development
    Replies: 1
    Last Post: 19-11-2010, 10:46 PM
  2. php/mysql select problem
    By Fragman in forum Software Development
    Replies: 3
    Last Post: 30-11-2009, 02:52 PM
  3. Replies: 2
    Last Post: 30-07-2009, 10:03 PM
  4. Mysql select from multiple tables for php.
    By afidelino in forum Software Development
    Replies: 4
    Last Post: 09-07-2009, 06:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,821,594.86197 seconds with 17 queries