Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
1 e-commerce site must show products from 2 databases
Old 01-17-2011, 07:19 AM 1 e-commerce site must show products from 2 databases
Skilled Talker

Posts: 83
Trades: 0
Hello,

I am running 2 different businesess, each has their own e-commerce website (php+mysql), and each has their own set of products.

Site A has about 5000 products (should be doubled in the next few years), site B has only a few hundred products.

Now there are some categories on site B that should also be displayed on site A. And here i run into troubles. The problem is not so much to show these categories in the categorie-list, but more for an overview page, like "new products", that should display all products, based on the date they were added. Thus, this list should be a mix of products from 2 databases. Of course, i can only query 1 database at a time, and then display all from the 1st database, and then from the second database, but then you loose the point of "new products", as they will no longer be sorted by date.

How would you get around this?

Thanks!

Matt

Last edited by killerwhale65; 01-17-2011 at 07:53 AM..
killerwhale65 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-17-2011, 01:18 PM Re: 1 e-commerce site must show products from 2 databases
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Merge the two arrays, sort the resulting array on date.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 01-20-2011, 12:32 AM Re: 1 e-commerce site must show products from 2 databases
Junior Talker

Posts: 1
Name: Sergey Kornilov
Trades: 0
MySQL allows you to select data from multiple databases in one select query as long as both databases are on the same server:

select * from db1.table1,db2.table2
where table1.id=table2.id

More info:
http://www.sialnity.com/2010/08/mysq...ltiple-tables/
__________________

Please login or register to view this content. Registration is FREE
- building the best PHP code generator, one byte at the time
phprunner is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to 1 e-commerce site must show products from 2 databases
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11627 seconds with 12 queries