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>"); Link to comment https://forums.phpfreaks.com/topic/170550-output-response-from-mysql/ 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. Link to comment https://forums.phpfreaks.com/topic/170550-output-response-from-mysql/#findComment-899614 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. Link to comment https://forums.phpfreaks.com/topic/170550-output-response-from-mysql/#findComment-899618 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? Link to comment https://forums.phpfreaks.com/topic/170550-output-response-from-mysql/#findComment-899629 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(). Link to comment https://forums.phpfreaks.com/topic/170550-output-response-from-mysql/#findComment-899639 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.