Re: [PHP] search for person by comparing his data with data in mysql

2008-12-20 Thread Andrew Ballard
On Sat, Dec 20, 2008 at 7:01 AM, Jochem Maas wrote: > c...@l-i-e.com schreef: >> select >> first_name like '%$first_name%' >> + 3 * last_name like '%$last_name%' >> + 7 * email = '$email' >> as score, > > that works?? I guess the expressions (e.g. email = '$email') > evaluate to bools and are au

Re: [PHP] search for person by comparing his data with data in mysql

2008-12-20 Thread Jochem Maas
c...@l-i-e.com schreef: > select > first_name like '%$first_name%' > + 3 * last_name like '%$last_name%' > + 7 * email = '$email' > as score, that works?? I guess the expressions (e.g. email = '$email') evaluate to bools and are auto-cast to ints. Im guess there needs to be some parenthesis i

Re: [PHP] search for person by comparing his data with data in mysql

2008-12-19 Thread ceo
select first_name like '%$first_name%' + 3 * last_name like '%$last_name%' + 7 * email = '$email' as score, first_name, last_name, email, person_id from person . . . order by score desc limit 10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.