Loading ...
Sorry, an error occurred while loading the content.

background highlighting

Expand Messages
  • rasni_raja
    Hello METY R. SORIANO , I think the following code will illustrate you how to change the background of the column which holds the date of the search-item.
    Message 1 of 1 , Mar 4, 2009
    • 0 Attachment
      Hello METY R. SORIANO ,

      I think the following code will illustrate you how to change the background of the column which holds the date of the search-item.

      Here I am testing "last_login" ,which is a date type of the user's last login with your searched date (i.e. $searchedItem).

      <?php
      $query="select * from registration where 1";
      $result=@mysql_query($query) or die(mysql_error());
      while ($myrow = mysql_fetch_array($result))
      {
      $emails[]=$myrow["email"];
      $fnames[]=$myrow["fname"];
      $lnames[]=$myrow["lname"];
      $states[]=$myrow["state"];
      $store_ids[]=$myrow["store_id"];
      $last_logins[]=$myrow["last_login"];
      }
      ?>
      <!-- result area starts here -->
      <?php for($i=0;$i<count($emails);$i++){?>
      <div class="grid_title" id="result<?=$i?>" style="background-color:<?php if($last_logins[$i]==$searchItem)echo "#F8F8F8";else echo "white";?>">

      <div style="float:left;width:200px;"><?php echo $emails[$i];?>
      </div>
      <div style="float:left;width:130px;"><?php echo $fnames[$i]." ".$lnames[$i];?>
      </div>
      <div style="float:left;width:90px;"><?php echo $last_logins[$i];?>
      </div>
      <div style="float:left;width:70px;">
      <?php echo $store_ids[$i];?>
      </div>
      <div class="small"><?php if($states[$i]) echo $states[$i]; else echo "N/A";?>
      </div>


      </div>
      <?php }?>
      <!-- result area ends here -->

      Regards,
      Arunjyoti Das
      Guwahati,
      India
    Your message has been successfully submitted and would be delivered to recipients shortly.