Stumped: MySQL corruption? DB Insert failing. PHP Code referencing a column in different table, but running correct code?

I have a function that updates two tables.  In my code I pass an ID field to be updated.  The ID comes from a javascript function/application.

I have made no changes to my code and at one time a couple of weeks ago, the code was working perfectly.

The error below is referencing 'delivery_detail.poID'.  The javascript does not reference delivery_detail, the PHP does not reference delivery_detail

I am using CodeIgniter MVC framework for my PHP.

The error is (from firebug):
Error Number: 1054
Unknown column ‘delivery_detail.poID’ in ‘where clause’
UPDATE `status_order` SET `status` = ‘Stock’, `stockDate` = 1272214095 WHERE `poID` = ‘52988’  </div>

function convertToStock ($poID=null) {
        if ($poID) {
        } else {
function convertStock($poID) {
        $orderArray = Array (
            'status' => 'Stock'
            ,'stockDate' =>now()
        $this->db->where('poID', $poID);
        $tallyArray = Array (
            'tallyStatus' => 'Stock'
            ,'stockDate' =>Now()
        $this->db->where('poID', $poID);
        return true;

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Muhammad KhanManager, ITCommented:
strange... although i too have no idea why this is happening.. but just a wild guess
status_order has any foreign key relationship with delivery_detail table?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TumacLumberAuthor Commented:
Aha..... no Foreign Key but I forgot it has a trigger.....The trigger is making the faulty reference.  That is the problem with not touching a piece of code for a few weeks....

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.