Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2004071

Re: [PHP-DB] Multiple SELECT From: Pablo M. Rivas (pmrivas01 <email protected>)
Date: 07/13/04

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