oriental_express Posted November 13, 2007 Share Posted November 13, 2007 Hi there guys Im currently doing a project and it is to do with storing charity information. What I would like to do is create a search box that will produce a table of results with whatever matched. my tabe struction is type,charitynum,name,address,postcode,county,town,website,phonefax and is displayed as so from the html. I would be greatful if i had some guidedance on how to create a search box. Any links would be greate as im having a hard time finding suitable threads to follow. Many thanks <table border="1" width="100%"> <tr> <td width="35" class="style1"><span class="style5">ID</span></td> <td width="78" class="style1"><span class="style5">Type</span></td> <td width="78" class="style1"><span class="style5">Charity no. </span></td> <td width="132" class="style1"><span class="style5">Name</span></td> <td width="194" class="style1"><span class="style5">Address</span></td> <td width="78" class="style1"><span class="style5">County</span></td> <td width="78" class="style1"><span class="style5">Town</span></td> <td width="72" class="style1"><span class="style5">Post code </span></td> <td width="150" class="style1"><span class="style5">Website</span></td> <td width="91" class="style1"><span class="style5">Phone</span></td> <td width="88" class="style1"><span class="style5">Fax</span></td> </tr> <p> <?PHP mysql_pconnect('localhost','root','Adm1n'); mysql_select_db("charitycw"); $results = mysql_query("SELECT * FROM charitylist ORDER BY id"); if ($results){ while ($a = mysql_fetch_array($results)) { echo'<TR> <TD>'.$a['id'].'</TD> <TD>'.$a['type'].'</TD> <TD>'.$a['charitynum'].'</TD> <TD>'.$a['name'].'</TD> <TD>'.$a['address'].'</TD> <TD>'.$a['county'].'</TD> <TD>'.$a['town'].'</TD> <TD>'.$a['postcode'].'</TD> <TD><a href="http://'.preg_replace("~http://~","",$a['website']).'/" target=/"_blank/">'.$a['website'].'</a></TD> <TD>'.$a['phone'].'</TD> <TD>'.$a['fax'].'</TD> </TR>'; }; print("</TABLE>"); } else { print("No results to display"); }; ?> </p> Quote Link to comment Share on other sites More sharing options...
oriental_express Posted November 13, 2007 Author Share Posted November 13, 2007 can anyone possibly help Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 13, 2007 Share Posted November 13, 2007 how are you storing this data in the first place? Quote Link to comment Share on other sites More sharing options...
oriental_express Posted November 13, 2007 Author Share Posted November 13, 2007 via my mysql database. everything is all sorted interms of project its just that i would like to add the search functionality to it Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 13, 2007 Share Posted November 13, 2007 look at the pagination tutorial on the site, it should help you alot Quote Link to comment Share on other sites More sharing options...
oriental_express Posted November 13, 2007 Author Share Posted November 13, 2007 thanks let me try that Quote Link to comment Share on other sites More sharing options...
oriental_express Posted November 13, 2007 Author Share Posted November 13, 2007 i checked it but couldnt not understand it. is there anything easier to understand. Would be great if someone helped. I know i gotta create a search box in html, but is the search php im worried about. thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.