mooeypoo Posted April 3, 2004 Share Posted April 3, 2004 Anyone knows how I can make sure a record is actually inserted properly into the mySQL database through PHP ? I remember there's something like "Records Affected" in ASP but I have no idea what it is in PHP, so far i'm doing it in the long and idiotic way of extracting them from the DB again to make sure its inserted properly ... anyone ? ~moo Link to comment Share on other sites More sharing options...
Dave Posted April 3, 2004 Share Posted April 3, 2004 http://www.php.net/manual/en/function.mysql-affected-rows.php Link to comment Share on other sites More sharing options...
Sayonara Posted April 3, 2004 Share Posted April 3, 2004 Most things in PHP return TRUE or FALSE when they succeed or fail. You can if( ) that returned value and, based on the results, echo a message like "records inserted" or "update failed! :-(". Link to comment Share on other sites More sharing options...
mooeypoo Posted April 3, 2004 Author Share Posted April 3, 2004 yeah Sayo, but I'm trying to find the WAY to find if they were inserted correctly or not, not the way to present them to my users. But yeah its a good idea to do in general as a debugging tool. Thanks Dave!!! I'll go check it out. btw did you know PHP's origin is israel, and that's why it has a few special Hebrew commands (like something like hebdevc() or something like that)... is that cool or WHAT! ha, I'm probly the only hebrew speaking person here so I'm prtobly the only one who finds it kool.. but still hehe thanks guys ~moo Link to comment Share on other sites More sharing options...
Sayonara Posted April 3, 2004 Share Posted April 3, 2004 I understand what you're trying to do - checking if a routine returns true or false is incredibly versatile (and good for providing an alternative route if something critical can't complete!). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now