adam84 Posted September 12, 2007 Share Posted September 12, 2007 I have two Databases(user, products), 1: users(userID, userName) - deals with all the user stuff 2: productInformation (purchaseID, productID, userID )- deals with products and customer purchases What I am trying to do is organize all the products by userName. This is what I have: SELECT p.purchaseID, p.productID, u.userName FROM products.productInformation p, user.users u WHERE p.userID = u.userID ORDER BY u.userName But this doesnt work? any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/68951-db-cross-referencing/ Share on other sites More sharing options...
Illusion Posted September 12, 2007 Share Posted September 12, 2007 this doesn't work means what? did you got any error? Quote Link to comment https://forums.phpfreaks.com/topic/68951-db-cross-referencing/#findComment-346770 Share on other sites More sharing options...
fenway Posted September 12, 2007 Share Posted September 12, 2007 I'd recommend this instead: SELECT p.purchaseID, p.productID, u.userName FROM products.productInformation p JOIN user.users u ON p.userID = u.userID ORDER BY u.userName But it should have worked syntactically both ways. Quote Link to comment https://forums.phpfreaks.com/topic/68951-db-cross-referencing/#findComment-347060 Share on other sites More sharing options...
liebs19 Posted September 12, 2007 Share Posted September 12, 2007 Do you have 2 databases or 2 tables? Quote Link to comment https://forums.phpfreaks.com/topic/68951-db-cross-referencing/#findComment-347128 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.