PDA

Click to See Complete Forum and Search --> : Search Script


vbnah
Feb 18th, 2006, 09:55 PM
Hell everyone, I've been making a search script for my website. Iam having troubles with the MySQL databasing though.

What object would query a table for keywords...

Thanks

AWC_Joe
Feb 18th, 2006, 10:16 PM
Heres a few ive used:
# general search
WHERE search_field LIKE '%".$_GET['q']."%'
# starts with letter "whatever"
WHERE search_field LIKE '".$_GET['q']."%''
# startes with number
WHERE search_field LIKE '[0-9]%''
# working with numbers, greated-then and less-then
WHERE search_field < '1970'


_

vbnah
Feb 18th, 2006, 10:22 PM
Ok so the code

# general search
WHERE search_field LIKE '%".$_GET['q']."%'


Basically searches for keywords 'q',

AWC_Joe
Feb 18th, 2006, 10:32 PM
Nope...

$_GET['q']
Will pull the info attached to the url.com?q=whatever

This would search for the keyword q WHERE search_field LIKE '%q%'

WHERE search_field LIKE '%search word%'

_

vbnah
Feb 18th, 2006, 11:20 PM
Ok great thanks for the help!