What mail program are you using? I'm getting mail parsing errors.

In addition, you have your From set as:

"Harry G" <harry (removethis)@gabha.net>

Likely, ( and ) aren't supposed to be in there (invalid chars) and it
also makes it impossible to reply to you. There is no other "from" or
"reply to" in the headers.

Answer to your question inline below.

On Mon, 26 Jul 2004 08:47:08 +1000,  <> wrote:
> Hi,
> I want to run a query on a table while joining it with other tables.
> Table 1- members
> id - firstname - middlename - ....- country - region3
> Fields country and region3 hold the integer codes for country and region3 is state
> Table 2- country
> id - countryname
> Countryname is where the actual Country name is stored and id is the country code
> Similarly Table 3 - region3
> id - region3 where region3 is the state name and id is the region code.
> I perform the following query to search the names in the database but the result 
> only gives me the integer values for Country and Region3. That's because, the code 
> is only stored in the database. But I need to join the table 2&3 with 1 so I can 
> extract names of country or region3 rather than integer values.
> How would I modify the query below?
> $keywords are the search words.

You want a JOIN, obviously. I'm assuming you're using Mysql. If you
aren't, you may need a different syntax.

> $query = "
>        SELECT id, firstname, familyname, middlename, fathername, region3, region4, 
> country,


>           MATCH(firstname, middlename, familyname, fathername) AGAINST ('$keywords' 
>           FROM members

LEFT JOIN country ON members.country = country.id

>        WHERE MATCH(firstname, middlename, familyname, fathername) AGAINST 
> ('$keywords' IN BOOLEAN MODE) ORDER BY score DESC";

And do the same kind of thing for region3.

DB_DataObject_FormBuilder - The database at your fingertips

paperCrane --Justin Patrin--

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to