herghost Posted November 2, 2009 Share Posted November 2, 2009 Hi All, I am working on a site and am using a free template, I noticed that the header bar has the following for a search script that I thought I would utilise: <input id="s" type="text" name="s" value="" /> <input id="x" type="submit" value="Search" /> However, I have no idea where to start! I want the results to be pulled from a table called stocks and to search the description coloum for matching words. I have a number of questions which I hope someone can answer 1, Does anyone have any good links/examples for something like this? 2, How would I display the results in a different page from header? Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/179972-search-mysql-from-php-page/ Share on other sites More sharing options...
JonnoTheDev Posted November 2, 2009 Share Posted November 2, 2009 Here is a basic tutorial to get you started http://www.spoono.com/php/tutorials/tutorial.php?id=12 However do not use this in a live website. This tutorial does not explain how to sanitize (make safe) any user inputted data prior to using in a database query. Here are some pages on this topic: http://www.phpro.org/tutorials/Filtering-Data-with-PHP.html http://uk2.php.net/strip_tags http://uk2.php.net/mysql_real_escape_string Quote Link to comment https://forums.phpfreaks.com/topic/179972-search-mysql-from-php-page/#findComment-949467 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.