php-db | 2004071
Date: 07/13/04
- Next message: Manuel Lemos: "[PHP-DB] Re: map algorithm"
- Previous message: Pablo M. Rivas: "Re: [PHP-DB] Column help needed (Table)"
- In reply to: Marcjon: "[PHP-DB] Multiple SELECT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello Marcjon,
do this:
"SELECT forumusers.*, forumuserprofiles.* from ".$godlyness['database_database'].".forumusers
LEFT JOIN ".$godlyness['database_database'].".forumuserprofiles ON
forumusers.username = forumusersprofiles.username where .... order
by...."
so.. if you do: where forumusers.username like "%doe%"
you will receive all users like "%doe%", and null values if she/he
has not profile.
http://dev.mysql.com/doc/mysql/en/JOIN.html
M> "SELECT
M> forumusers.email AS email,forumusers.username AS username,forumusers.level AS level,
M> forumusers.lastlogon1 AS lastlogon1,forumusers.lastlogon2 AS lastlogon2,forumusers.settings1 AS settings1,forumusers.confirmationcode AS confirmationcode,
M> forumuserprofiles.sex AS sex, forumuserprofiles.birthdate AS birthdate,
M> forumuserprofiles.address_msnm AS address_msnm, forumuserprofiles.address_aim AS address_aim,
M> forumuserprofiles.address_yahoo AS address_yahoo, forumuserprofiles.address_icq AS address_icq
M> FROM ".$godlyness['database_database'].".forumusers,".$godlyness['database_database'].".forumuserprofiles ".$filterbu."
M> ORDER BY username
M> "
-- Best regards, Pablo-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Manuel Lemos: "[PHP-DB] Re: map algorithm"
- Previous message: Pablo M. Rivas: "Re: [PHP-DB] Column help needed (Table)"
- In reply to: Marcjon: "[PHP-DB] Multiple SELECT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

