SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,033
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Bizarre problem with MySQL Update not working via Php

    Hi,

    I am having a really bizarre problem!
    That is I am updating a series of MySQL fields via Php While Loop.
    However the 1st row is getting Updated but the other rows are not getting Updated regarding the MySQL Update, but they are getting executed regarding all other commands in the Loop!
    And I have checked the MySQL Update commands, they are fine as they execute fine inside MySQL.

    What could be causing this!!!!
    In case, I have gone ahead and printed out a few lines of the Loop, printing out the MySQL Update command and following action in that Loop.


    (1): UPDATE pap SET cc_number = '5424*******9191' WHERE id = 4156 AND user_id = 705| INSERTed cc_rem: 18082153

    (2): UPDATE pap SET cc_number = '4388*******1002' WHERE id = 4157 AND user_id = 705| INSERTed cc_rem: 57602872

    (3): UPDATE pap SET cc_number = '4388*******1002' WHERE id = 4168 AND user_id = 664| INSERTed cc_rem: 57602872
    .............

    What in GODs name could be causing only the 1st MySQL Update to run and not others in the While Loop?

    Anoox search engine volunteer

    www.anoox.com

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Can you please post the code of the while loop?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,033
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    SpacePhoenix, I already figured what the problem was.
    A function in the While Loop was connecting to another MySQL DB on another Server so when the Loop continued then the MySQL commands to execute on the 1st server were not being executed!
    Unbelievable, wasted a day of my time

    You know, MySQL should give an Error message when one is trying to execute a Query whose Table does not exist DB Connection X!

    Thank anyway man.

    Anoox search engine volunteer

    www.anoox.com


Bookmarks

Posting Permissions

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