Omzy Posted August 16, 2009 Share Posted August 16, 2009 Lets say I run a mysql query in my php script, I want a message to be output with the mysql response, for example "1 row added", or "2 rows affected". Currently I've got it to output an error message if it fails, as follows: mysql_query($query) or die("<b>Error " .mysql_errno($connect). " - " .mysql_error($connect). "</b>"); Quote Link to comment Share on other sites More sharing options...
Andy-H Posted August 16, 2009 Share Posted August 16, 2009 You may find mysql_affected_rows useful. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted August 16, 2009 Share Posted August 16, 2009 Off topic, but if you want to improve your error handling, have a look at Daniel's "or die() must die" article. Quote Link to comment Share on other sites More sharing options...
Omzy Posted August 16, 2009 Author Share Posted August 16, 2009 How can I output the exact response that mysql produces? Quote Link to comment Share on other sites More sharing options...
thebadbad Posted August 16, 2009 Share Posted August 16, 2009 Does it normally say more than Affected rows: 1 or similar? But have a look at mysql_info(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.