Page 1 of 1

Got a big problem with my code

Posted: Sat Feb 26, 2005 4:24 am
by wizzard81
Hello,

I'm having a big problem. I have 2 different databases called DMD and GD.

In DMD i have my tables customers, projects in my table GD i got my table profiles.

Now i want to show the last 2 active profiles (LIMIT2). I need to link profiles.cust__id to customers and projects because i need to check the enddate of their project.

The problem is that profiles is in another database. I cannot find a working solution :(

Posted: Sat Feb 26, 2005 5:29 am
by n00b Saibot
Read more on JOINS.

Posted: Sat Feb 26, 2005 5:29 am
by timvw
if you have access rights to that other database, you should be able to

Code: Select all

select *
from table, otheruser.table as t2

Posted: Sat Feb 26, 2005 5:32 am
by wizzard81
Thanks alot. I didn't know it was possible to work with different users

Posted: Sat Feb 26, 2005 5:37 am
by wizzard81
Do you maybe have a tutorial of this?

Posted: Sat Feb 26, 2005 5:42 am
by n00b Saibot
post the db structure. maybe we will work out the SQL...

Posted: Sat Feb 26, 2005 5:45 am
by wizzard81
DB_DMD

Customers table => id, name, address, postcode, city, state, country, password

Projects table= id, project_id, cust_id, enddate

DB_GD

Profiles table => id, cust_id, name, birthday, email, biography, discography