Searching the database

From: Date: Sat, 06 Oct 2001 16:55:24 +0000
Subject: Searching the database
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70226@lists.php.net to get a copy of this message
Hello My first attempt at building a PHP/MySql database is proving to be very 'interesting' :-) I would like to know how to make it search for words mid sentence ... at the moment it will only look at the begining of each entry. So if I type in Michael it will display Michael David Smith, Michael Andrew Jones etc etc. However, If I type David ... nothing is displayed. I believe this is the line that defines how the database is searched and I believe the fix needs to be there ... but I don't know how to! ... so any advice will be appreciated: $result = mysql_query ("SELECT * FROM example WHERE artists LIKE '$artists%' AND aside LIKE '$aside%' ORDER BY name ASC"); TIA ... Mick

« previous php.general (#70226) next »