SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with a while loop inside a if statement.

    I need the items and the subject menu to stay weather the users click in a item or not.

    The code below shows the shoe kind (subjectmenu) and below it the shoes of that kind appear padding-left:20px ten pixels more to the right than shoekind table(submenu). I have set it up that way so the users can see and identify the shoes by its kind.
    It hides the shoes inside the shoekind field or Subjectmenu and the shoes will only be visible if users click on the shoekind field. Once they click on the subjectmenu all the shoes comes to visibility and users will be able to choose what shoes they want. onto that point everything works good in the code below. But when users click in the shoe or a submenu then it shows the shoes in a table to right of the screen which I have set up, but at the same time the shoekind field hides all the shoes again instead of leaving displayed the shoes under the shoekind field regardless the users clicked on one shoe under it. I want it to still displaying the shoes even though users click on one of the shoes. Again The code below hides shoemenu inside shoekind once click on a shoekind display the shoes available and once I click on a shoes it hides all the shoes again inside the shoekinc or menusubject and instead of hiding the s hoes I want then to stay whether a users click on one or not.

    How can I arrange the coding so it display the shoes below the shoekind field and leave whether a users click on an item (shoe) or not.

    Help Please
    PHP Code:
       
      $query 
    "SELECT * 
                  FROM shoes 
                WHERE kind_id = 
    {$menusubject["id"]}";
      
    $shoes_set mysql_query($query$connection);
      if(!
    $shoes_set){
      die(
    "Database query failed:" mysql_error());} 
    echo 
    "<ul class=\"shoecategories\">";
      if (
    $shoekind["id"] == $sel_shoe['id']) {
      while(
    $rshoe mysql_fetch_array($regularshoe_set)){
      echo 
    "<li"
      if (
    $rshoe["id"] == $sel_shoe) {
      echo 
    " class=\"selected\"";
      } 
      echo 
    "><a href=\"shoe1.php?menu=" urlencode($rshoe["id"]) ."\";>{$rshoe["shoename"]}</a></li>";  }
      }
      

       echo 
    "</ul>"
    Last edited by co.ador; May 13, 2009 at 06:34.


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
  •