Making Search Fields Compulsory

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   re: Making Search Fields Compulsory
jcb
CZ Active Member
 Codezwiz Site Donator
uk.gif
Occupation: Soldier
Age: 49
Gender: Male
Fav. Sports Team: England
Status: Offline
Joined: Oct 20, 2003
0.02 posts per day
Posts: 135
Points: 7,618
   
WAHOOOOOO !!!!!!

I have figured it out !!!!! (and im a PHP noob too) lol

OpenTable();
echo"<table width=\"100%\" border=\"1\">
        <tr bgcolor=\"#FFCCCC\">
          <td width=\"5%\"> <div align=\"center\"><strong>Serial Number</strong></div></td>
          <td width=\"20%\"> <div align=\"center\"><strong>Last Name</strong></div></td>
          <td width=\"20%\"> <div align=\"center\"><strong>First Name</strong></div></td>
          <td width=\"5%\"> <div align=\"center\"><strong>Age</strong></div></td>
          <td width=\"10%\"> <div align=\"center\"><strong>Born In County</strong></div></td>
          <td width=\"20%\"> <div align=\"center\"><strong>Parish</strong></div></td>
          <td width=\"20%\"> <div align=\"center\"><strong>Folio Number</strong></div></td>
        </tr></table><br>";
             
//error message (not found message)
$XX = "<br><br><br><br><center><b>Sorry, No Records Were Found</b></center>";
$query = mysql_query("SELECT * FROM $usertable WHERE $census LIKE '%$search%' LIMIT 0, 30 ");
while ($row  =  mysql_fetch_array($query))
   {
        $variable1=$row["Ser_No"];
        $variable2=$row["Last_Name"];
        $variable3=$row["First_Name"];
        $variable4=$row["Age"];
        $variable5=$row["Born_In_County"];
        $variable6=$row["Parish"];
      $variable7=$row["Folio_Number"];
   

print ("<table width=\"100%\" border=\"1\">
        <tr>
          <td width=\"5%\">$variable1</td>
          <td width=\"20%\">$variable2</td>
          <td width=\"20%\">$variable3</td>
          <td width=\"5%\">$variable4</td>
          <td width=\"10%\">$variable5</td>
          <td width=\"20%\">$variable6</td>
          <td width=\"20%\">$variable7</td>
        </tr>
      </table>");
       
   }

//below this is the function for no record!!
if (!$variable1)   
{
print ("$XX");
}
//end
CloseTable();
include ("footer.php");


That did the trick !!!

Thanks for your time K-H

NOJ75



_________________
PHP Super NooB
Back to top Reply with quote
#2   
jcb
CZ Active Member
 Codezwiz Site Donator
uk.gif
Occupation: Soldier
Age: 49
Gender: Male
Fav. Sports Team: England
Status: Offline
Joined: Oct 20, 2003
0.02 posts per day
Posts: 135
Points: 7,618
   
Ok, now I really am stuck. icon_sad.gif icon_sad.gif icon_sad.gif

Does anyone know what code I need to add so that I can display so many results per page.?

I am amble to limit the search results to what ever i see fit but I now need to add a facility where I can add "Next 15 Results" on a different page. So each page contains the number of results I choose.

Any help please?

Regards

NOJ75




_________________
PHP Super NooB
Back to top Reply with quote
#3   re: Making Search Fields Compulsory
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.49 posts per day
Posts: 3765
Points: 351,412
   
YVW, although I didn't do anything but nudge you in the right direction. icon_wink.gif

This may help you with your paging question:
[ Register or login to view links on this board. ]



Back to top Reply with quote
#4   
jcb
CZ Active Member
 Codezwiz Site Donator
uk.gif
Occupation: Soldier
Age: 49
Gender: Male
Fav. Sports Team: England
Status: Offline
Joined: Oct 20, 2003
0.02 posts per day
Posts: 135
Points: 7,618
   
Thanks for the reply,

I had a look at that link but that really is above my pay level. lol

Looking at my above code, could you or anyone tell me what I need to add and where I need to add it?

Sorry but this one is above me.

TY

NOJ75




_________________
PHP Super NooB
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum