Jump to content

millercepbs

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

millercepbs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here's what I have right now. Maybe you could guide me from that code? [code] <select name="cmbSelect" id="cmbSelect"> <?php     do{   ?> <option value="<?php echo $row_rsCategory['categoryID']?>"<?php if (!(strcmp($row_rsCategory['categoryID'], "$selectedCategory"))) {echo "SELECTED";} ?>><?php echo $row_rsCategory['categoryDesc']?></option><?php }     while ($row_rsCategory = mysql_fetch_assoc($rsCategory));     $rows = mysql_num_rows($rsCategory);     if($rows > 0)     {         mysql_data_seek($rsCategory, 0);         $row_rsCategory = mysql_fetch_assoc($rsCategory);     } ?> </select> [/code]
  2. Thanks so much for helping! That does exactlly what I was trying to do. But something I didn't expect happens now. The combo box value still resets to default. I thought I could just use <?php echp $_POST['cmbSelect']; ?> but that killed the page and using $selectedDepartment is what reverts it to the default value. It's not a huge deal, but it could be confusing if you don't remember what item you had done the search on...say I searched in Billing, but when I got to page 4 of the Billing Department, it would have been reset to Accounting...so mindgames so say the least. Your help would be MUCH appreciated again. THANKS! A little premature happiness I'm afraid. When I went and check it, the value in the combo box changing alters the results of the query. So if I search for a department, then the values do query corerectly, but if I move to the next page, the combo box resets. Now if I go back to page one, the values displayed are for that default combo value instead of what I serached for.
  3. It's amazing the discoveries you make when you add large amounts of data to something you've tested already. "It used to work, and now it doesn't". I have a query that uses the value from a combo box to make a list...ie the user selects a department from the combo box and gets all items located in that department. I list 25 items per page, but when i go to my next page, I lose all my data and my combo box resets itself to the default value. I can still scroll through the pages of blank, but that's not real helpful. I was thinking that maybe a session variable would work for this, but I'm new to it all so I'm not sure if I'm looking at the wrong kind of solution. Plus I'm not sure that my implementation of _session was correct. Here's how I have it set now: $currentPage = $_SERVER["PHP_SELF"]; $selectedDepartment = $_POST['cmbSelect']; and my query just uses the variable as part of a conditional: WHERE inv_inventory.departmentID = '$selectedDepartment' Any guidance would be appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.