Pregunta

I need advice. I have multiple vendors to shop and everyone has a different structure of the tables, so I thought for each vendor to create a new database, but I have a little trouble reading the DB website. Can you advise me on how best to read and display products to the site from multiple databases?

(translated by google, sorry for language bugs)

¿Fue útil?

Solución

Use mysql Join operation. Ex:

   $result= mysql_query("SELECT table1.tutorial_id, table1.tutorial_author, table2.tutorial_count
         FROM tutorials_tbl tablea JOIN tcount_tbl table2
         ON table1.tutorial_author = table2.tutorial_author");

Otros consejos

Well easiest would be to get them to provide you with a XML feed which you consolidate in your own database. So once a day you call their feed, update your database and read from your database. Unless there is something I am missing that should work.

You could switch between database by using $mysqli->select_db('my_db') bu you will probably have to define different class structure for every database, I actually don't know what is your project's logic so I'm guessing here.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top