Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,143,354 members, 7,780,946 topics. Date: Friday, 29 March 2024 at 06:10 AM |
Nairaland Forum / Science/Technology / Programming / Help Needed Urgently On How To Create A Search Script (772 Views)
Help Needed Urgently On Visual Basic. Experts Please! / Is Nairaland Becoming A Search Engine? / This Is My 1st Web App Ever - A Search Engine For Africans (2) (3) (4)
Help Needed Urgently On How To Create A Search Script by charliebiz(m): 3:15pm On Mar 04, 2009 |
how do i create a search script using php that will search the specified number the user search in the database |
Re: Help Needed Urgently On How To Create A Search Script by yawatide(f): 3:43pm On Mar 04, 2009 |
Pardon my ignorance but to me, your question doesn't make sense. Could you help me and perhaps others out by giving more detail? Like: The site you are working on, what you are trying to accomplish, the code you have so far, etc. The more you specify, the better the quality of help you get in return. Right now, your question is like one of those vague secondary school essay assignments, "Write on Agriculture in Nigeria". I mean, where do I start? Thanks, |
Re: Help Needed Urgently On How To Create A Search Script by dammytosh: 3:50pm On Mar 04, 2009 |
yawa-ti-de:The question is really discombobulating |
Re: Help Needed Urgently On How To Create A Search Script by charliebiz(m): 7:35pm On Mar 04, 2009 |
Sorri for the not too clear a discombobulating post. This is actually what i want. I created a database and another page where information can be entered from the page into the database. Now, i am having problem creating a search page where users can enter a number or word and it will display the recordset or items in the row or the number. For example i entered 12345678 into my database and i now gave out this number to a client to search using my search script, what i would expect the person to get is the items on the recordset that follows the number 12345678 in the same row. Hope this is clear enough. this is the code i used for creating the search script bt it is not working a s i wanted it to. This is the search page which is suppose to post the result on the same page <?php //This is only displayed if they have submitted the form if ($searching =="yes" { echo "<h2>Tracking Results</h2><p>"; //If they did not enter a search term we give them an error if ($courier == "" { echo "<p>You forgot to enter a search term"; exit; } // Otherwise we connect to our Database mysql_connect("nevermind", "nevermind", "nevermind" or die(mysql_error()); mysql_select_db("nevermind" or die(mysql_error()); // We preform a bit of filtering $courier = strip_tags($courier); $courier = trim ($courier); //Now we search for our search term, in the field the user specified $data = mysql_query("SELECT * FROM tracking WHERE courier LIKE '$file'" //And we display the results while($result = mysql_fetch_array( $data )) { echo $result['file']; echo " "; echo $result['file']; echo "<br>"; } //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } //And we remind them what they searched for echo "<b>Searched For:</b> " .$file; } ?> and this is the form <form id="search" method="Post" action="<?=$PHP_SELF?>"> <p><img src="graphics/track1.jpg" alt="" width="161" height="140" align="left" /><img src="graphics/00_POD_side.gif" alt="" width="161" height="48" /></p> <p> <input type="text" name="file" /> </p> <p> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="submit" /> </p> <p> </p> </form> Please i need urgent replies. |
(1) (Reply)
Need Help On How To Install Xrojan.dll? / Maple 13 / Here Is A Wonderful Tool/software For All Programmers
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15 |