MX Query Builder Forum :: null values display all

This thread was displayed: 0 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
Roger Goodwin
04-02-2007 12:29:22 GMT +2

I have a basic search form with 6 menus. each menu has several choices including "all" where "all" (which is sending a null value) will show all results in the database for that field. When i send this to a record query i get no results! if i choose any of the values in the menu it gives me the corect result.

the form code is below.

 

 <form action="all_results_page.php" method="post" name="form1" id="form1">
        <table width="239" height="150" border="0" align="center" cellpadding="0" cellspacing="0">
          
           <tr>
             <td width="49" class="main_text"><div align="left"><span class="style3 style7">District</span></div></td>
             <td width="151"><select name="district" id="district">
                 <option value="">All</option>
<?php
do { 
?><option value="<?php echo $row_district['district']?>"><?php echo $row_district['district']?></option>
                   <?php
} while ($row_district = mysql_fetch_assoc($district));
  $rows = mysql_num_rows($district);
  if($rows > 0) {
      mysql_data_seek($district, 0);
   $row_district = mysql_fetch_assoc($district);
  }
?>
                            </select>             </td>
           </tr>
           <tr>
             <td class="main_text"><div align="left"><span class="style3 style7">Location</span></div></td>
             <td><select name="location" id="location">
               <option value="All">All</option>
               <?php
do { 
?><option value="<?php echo $row_location['location']?>"><?php echo $row_location['location']?></option>
                 <?php
} while ($row_location = mysql_fetch_assoc($location));
  $rows = mysql_num_rows($location);
  if($rows > 0) {
      mysql_data_seek($location, 0);
   $row_location = mysql_fetch_assoc($location);
  }
?>
                            </select>             </td>
           </tr>
           <tr>
             <td class="main_text">&l

View full message
Back | Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
04-03-2007 11:58:15 GMT +2

Hello,

Since this is custom code, I'm afraid that we cannot help you implement this.

For this to work, you would need to specify the where condition to look something like this:

WHERE fieldname LIKE %param%""

as this will return all records when param is empty.

Regards,
Razvan RACASANU

Reply | Quote | Top
© Adobe Systems Romania. All rights reserved.