Continue on Mysql error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Bedford

    Continue on Mysql error

    I've an insert statement that takes datas from XML files. Sometimes, for
    some reasons, the XML file get corrupted. If it's the case, the script
    crashes and it doesn't continue, even if the following items are ok.

    How to let the script continue, even if there is an "insert" error (or any
    error). I won't my script to stop. I will be able to log where the problem
    is then continue the script. I can then come back later to analyse the
    corrupted file.

    Bob


  • R. Rajesh Jeba Anbiah

    #2
    Re: Continue on Mysql error

    Bob Bedford wrote:[color=blue]
    > I've an insert statement that takes datas from XML files. Sometimes,[/color]
    for[color=blue]
    > some reasons, the XML file get corrupted. If it's the case, the[/color]
    script[color=blue]
    > crashes and it doesn't continue, even if the following items are ok.
    >
    > How to let the script continue, even if there is an "insert" error[/color]
    (or any[color=blue]
    > error). I won't my script to stop. I will be able to log where the[/color]
    problem[color=blue]
    > is then continue the script. I can then come back later to analyse[/color]
    the[color=blue]
    > corrupted file.[/color]

    This can be achieved by "stacking" the errors using
    set_error_handl er() <http://in2.php.net/set_error_handl er> Also, search
    for some classes on this error handling. I have a class which when
    configured can do exactly this--but can't outsource it now as it is
    quite proprietary.

    --
    <?php echo 'Just another PHP saint'; ?>
    Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

    Comment

    Working...