One database accessed by multiple websites - HELP

Discussion in 'MySQL' started by nicedeals, May 24, 2006.

  1. #1
    I have roughly 4000 car products for sale on my main website stored in the form of a single mysql databse.
    I was wondering, what would be the easiest way to open several new websites with each specialising in a different make ( e.g. Audi, BMW etc ) and get each new website to take the relevant info from the main mysql databse so I dont have to edit the products in my main website + each and every new site I create everytime there is a price change etc.

    Surely there has to be a simple procedure for doing this
    Any Help greatly appreciated.
     
    nicedeals, May 24, 2006 IP
  2. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #2
    You can just make your other sites get their data from the same database. You'll need to filter the products you want displayed but that should be fairly trivial.
     
    dct, May 24, 2006 IP
  3. nicedeals

    nicedeals Active Member

    Messages:
    679
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #3
    sounds simple.but i have very limited knowledge of mysql.
    also..I have been using oscommerce for my main site and not too happy with it...what alternatives does I have to oscommerce for my new sites?
     
    nicedeals, May 24, 2006 IP
  4. paradoxic

    paradoxic Member

    Messages:
    67
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    43
    #4
    Another alternative is using a prefix for each manufacturer's data for the table name:

    audi_price
    audi_descrip

    bmw_price


    etc.

    This would make the data easier to manage through queries.

    If you are considering splitting database access among many webservers, you will get extremely slow pageloads if the database machine and the website aren't on the same server or at least the same network.

    You can easily share the database among many machines, just give the IP/hostname of the webserver the proper permissions in mysql.
     
    paradoxic, May 24, 2006 IP
  5. nicedeals

    nicedeals Active Member

    Messages:
    679
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #5
    The websites and the database are all with the same host on the same server...how do I set the proper permission for this?
     
    nicedeals, May 24, 2006 IP
  6. forkqueue

    forkqueue Guest

    Messages:
    401
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you don't know what you're doing (and it sounds like you don't), I'd advise you get someone who does to undertake the task on your behalf.

    I'm sure there are plenty of coders on here who would be happy to help you for a small payment.
     
    forkqueue, May 25, 2006 IP
  7. nicedeals

    nicedeals Active Member

    Messages:
    679
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #7
    yeh..that would be the next step..any reasonably priced coders here??:D
     
    nicedeals, May 25, 2006 IP
  8. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #8
    Hi,
    This is what you have to do.
    Currently you are connecting using something like this:
    mysql_connect(localhost,usernamehere,passwordhere);

    Instead of this, use:
    mysql_connect(Server-IP-here,usernamehere,passwordhere);

    Example if your username is "admin" and password is "pass", domain name is "yourdomain.com", then first connection string (when connecting from same domain) will look like:
    mysql_connect(localhost,admin,pass);

    Now it becomes on domain2.com :
    mysql_connect(1.2.3.4,admin,pass);
    where 1.2.3.4 is the IP address of "localhost.yourdomain.com"

    If you use it, then PLEASE change the IP I mentioned above. That's only to show you. Replace it with your own IP for the domain where you actually have the mysql located.
    Your web host will give it to you. Tell them that you want "IP" for "localhost.yourdomain.com"

    If you still have problem or don't want to do it yourself, then please let me know.

    Regards
    jeet
     
    JEET, May 25, 2006 IP
  9. nicedeals

    nicedeals Active Member

    Messages:
    679
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #9
    what i want is a simple template design which i can use to reproduce in multiple sites. the products displayed will just have the desciption and the price accessed from my main mysql database. One site will be BMW only, other wil be covering citroen only etc. There will be no purchase portals on these sites..its just to be a simple item pic. item description and item price.
    "JEET"..can you incoporate this into a template and how much will you charge me?
     
    nicedeals, May 26, 2006 IP
  10. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #10
    Hi,
    I have sent you a PM regarding the work you want to be done.
    regards
    jeet
     
    JEET, May 26, 2006 IP