Skip to main content
January 30, 2011
Question

Coldfusion pulling data from 2 dsn's?

  • January 30, 2011
  • 2 replies
  • 633 views

few months back a friend of mine who owns a few small shops over the UK enlisted my help to clone the web based admin area of an existing store, and apply it to a new store.

Only until after i had created the clone, did i realise the database contained information relating to each individual site, eg OrderSite and ItemSite fields.
I did it the long way, i created a copy of the database, cleared all the tables contents and started from scratch.

Now its come back to bite me.

When i go to the orders section, and click on an order number it shows the order just fine...except it merges the order numbers from the two stores.
When an order is submitted (and by order i mean transaction in the store) it only goes into the cloned database, not the old one, as ive browsed it via phpmyadmin and the only orders there are the orders from the new store.

So i know that its pulling from both and merged

rather than being inserted into both, and being pulled from 1 database with all of the orders.

This is the only relevent SELECT query in the code:

Pastebinned for convenience.


http://pastebin.com/FST8kWDg

I plan on making a quick fix so the admin area is usable, then working on creating it again making use of the SiteID's etc.
Ive tried modifying and deleting parts of this but it either messed it up more or just has no effect.

Ive trawled through the page and changed all the DSN's to the correct one, so i have NO idea why its still contacting the old database 😕😕

Any help would be awesome.

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    January 31, 2011

    port21 wrote:

    Ive trawled through the page and changed all the DSN's to the correct one, so i have NO idea why its still contacting the old database :/

    The datasource settings in the ColdFusion Administrator determine the database that ColdFusion will contact. So, it is very likely that the old database is still configured for use in the Administrator.

    January 31, 2011

    BKBK,

    Im developing live on the server, how could i find out if its still including the old DSN?

    Inspiring
    January 30, 2011

    Drop the old database.  In your onError method, send yourself an email of the cgi variables.  That will tell you what page is still pointing to the old db.

    January 31, 2011

    Sorry mate, can you elaborate slightly on how to do that?

    Im quite new to coldfusion.

    Cheers mate.

    Inspiring
    January 31, 2011

    Which bit:

    * dropping the DB (I would not drop it, I'd just switch it off temporarily... but this is a DB question, not a CF question)

    * using onError (Google is always your friend here, eg "coldfusion onerror", but here's the link to the docs: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d4a.html)

    * the reference to CGI variable (you can google that one easily enough, as per above)

    ?

    --

    Adam