Got a big problem with my code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Got a big problem with my code

Post 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 :(
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

Read more on JOINS.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Post by wizzard81 »

Thanks alot. I didn't know it was possible to work with different users
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Post by wizzard81 »

Do you maybe have a tutorial of this?
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

post the db structure. maybe we will work out the SQL...
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Post 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
Post Reply