Jump to content

browneyes

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

browneyes's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I'm trying to make a classified ad. I made a table for the main category and for the sub category. When the user will select from the main category, I'd like to display just those in the subcategory. I really tried but I can't solve it yet. Here's the code. <form name="form1" method="post" action=""> <select name="select" size="10"> <?php do { ?> <option value="<?php echo $row_Recordset1['mid']?>"><?php echo $row_Recordset1['mdesc']?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> <select name="select2" size="10"> <?php do { ?> <option value="<?php echo $row_Recordset2['sid']?>"><?php echo $row_Recordset2['sdesc']?></option> <?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); $rows = mysql_num_rows($Recordset2); if($rows > 0) { mysql_data_seek($Recordset2, 0); $row_Recordset2 = mysql_fetch_assoc($Recordset2); } ?> </select> </form> Is there a better way of doing this? Any site you recommend? Any info would be greatly appreciated. --Browneyes
×
×
  • 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.