![]() if you want to do something with an error, simply add an else clauseĪlso, I obviously don't know your code or what exactly you're doing, but looping n times and calling checkValid() and updateUsers() without parameters seems like very poor practice. I have a foreach loop that is suppose to check to see if a checkbox is checked by an item. optional: save the exception in case we want to know about it If you have tried to use a break statement within a forEach loop then you would have got the error Uncaught Synta圎rror: Illegal break statement, which is expected because you can only use the break statement inside the direct scope of a loop, and not a function (even if the function is inside of the loop). returns true if valid, false otherwise Each try must have at least one corresponding catch or finally block. Code may be surrounded in a try block, to facilitate the catching of potential exceptions. An exception can be throw n, and caught (' catch ed') within PHP. ![]() See if this makes any sense for your use case (I'll grant, it may not). PHP has an exception model similar to that of other programming languages. With PHP 5 came a new object oriented way of dealing with errors. ![]() It sounds like you're using exceptions as booleans, I'd suggest avoiding that, as it gets confusing quickly, unless you really need the contents of the exception. Your error is a MySQL error, caused by the information youre sending MySQL to tell it what to retrieve.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |