Search a Mysql Database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Maluendaster
Forum Contributor
Posts: 124
Joined: Fri Feb 25, 2005 1:14 pm

Search a Mysql Database

Post by Maluendaster »

...
Last edited by Maluendaster on Sat Jan 21, 2006 9:21 pm, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You need to use the LIKE clause for the search I'll guess (depending upon your needs). You can use the MySQL function CONCAT() to build the hyperlink too ;)

Code: Select all

select
    concat('<a href="', url, '">', name, '</a>') as hyperlink
from
    tbl_name
where
    name like '%$search_input%'
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Databases.
Post Reply