By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,918 Members | 1,557 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,918 IT Pros & Developers. It's quick & easy.

how can i display a search output like of this that could be clicked or have a link

P: 6
this is my code
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     mysql_connect ("localhost", "root","")  or die (mysql_error());
  3.     mysql_select_db ("nsca_alumni");
  4.  
  5.     $firstname = $_POST['firstname'];
  6.     $lastname= $_POST['lastname'];
  7.     $year_grad= $_POST['year_grad'];
  8.     $country= $_POST['country'];
  9.     $sql = mysql_query("select * from mymembers where firstname like '%$firstname%' and lastname like '%$lastname%' and year_grad like '%$year_grad%' and country like '%$country%'");
  10.  
  11.  
  12.     echo "<center><table width='50%' border='0' class='tbody' cellpadding='5'>";
  13.         echo "<tr class='thead'> <th>First Name</th><th>Last Name</th><th>Year Graduated</th><th>Country</th><th></th></tr>";
  14.  
  15.     while ($row = mysql_fetch_array($sql)){
  16.         $ID =$row['id'];
  17.           $ID=$row['id'];
  18.  
  19.  
  20.     echo "<tr class='t_text'><td>"; 
  21.     echo $row['firstname'];
  22.     echo "</td><td>"; 
  23.     echo $row['lastname'];
  24.     echo "</td><td>"; 
  25.     echo $row['year_grad'];
  26.     echo "</td><td>"; 
  27.     echo $row['country'];
  28.     echo "</td><td>"; 
  29.  
  30.  
  31.  
  32. echo "</table>";
  33.  
  34. ?>
  35.  
how could i display like of http://alumni.guilford.edu/s/1397/in...&pgid=8&cid=46

when u search on this site like firstname or lastname.you will see the output..can u help me please about the code..thanks
Feb 5 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.