Jump to content

Search MYSQL From PHP page


herghost

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/179972-search-mysql-from-php-page/
Share on other sites

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.