Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    2
    Plugin Contributions
    0

    Default Accessing a table from another site

    Hi,


    I would like to update the orders_products table from another system.
    For this I will start a new script in the zen cart environment and I need to know how to connect to the database so I can use SQl to update the table. I am thinking there has to be some script somewhere that does that and I just need to call it. Any help would appreciated. I am new to Zen cart but I know PHP and MYSQL.

    I would have to think that that this has been asked before but I can't find it.

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Accessing a table from another site

    I'm not sure why you're asking what you're asking.
    If you're familiar with PHP and MySQL, then I'm sure you're not asking "how do I make a database connection in PHP to MySQL", nor are you asking "how do I access the particular table".

    Plus, I don't understand why you'd be "updating" the orders_products table from a remote system ... That table should really only be "read" once the order is placed ... why would you be changing which products were in a certain order?

    So ... I think the "answer" to whatever your situation is ... is rather nebulous without you being more clear about what you're trying to accomplish and why.

    As to there being some sort of remote-access API to alter data that shouldn't be altered, no, that doesn't exist.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2007
    Posts
    2
    Plugin Contributions
    0

    Default Re: Accessing a table from another site

    Thanks for taking the time to address my question I figured out waht I was looking but since you took the time to try to help out I will explain what I am doing .

    I use Zen Cart to sale software. The software runs on web sites.

    I am doing a rather simple license control system.

    I am adding two columns to the product_orders table. One of them will be a license number and the other one will be a domain name
    The buyer of the software will be given the license number at purchase time.

    On the client's website, an install program will execute a REST CALL that will start an script on the website where I have Zen Cart installed. This script is the one that needs to access products_orders and update the product_orders table with the domain name where the product is being installed.

    I found out that I need to have the following lines at the beginning of my script to then be able to get to the table:


    include 'includes/application_top.php';
    mysql_select_db( DB_DATABASE , $db );

    These two lines answer my question and the table is being updated now
    Last edited by BlueCrystal; 30 May 2008 at 05:52 AM.

 

 

Similar Threads

  1. How do I block SE bots from accessing my site?
    By nicksab in forum General Questions
    Replies: 1
    Last Post: 27 Feb 2013, 10:30 AM
  2. Replies: 3
    Last Post: 24 Feb 2013, 11:54 AM
  3. Accessing ZenCart from another computer
    By emf2718 in forum Basic Configuration
    Replies: 1
    Last Post: 30 Oct 2010, 02:11 AM
  4. Accessing a database table
    By Davep in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 18 Feb 2008, 02:41 AM
  5. catalog from another site
    By sparktronic in forum General Questions
    Replies: 4
    Last Post: 19 Feb 2007, 01:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg