abdfahim Posted February 19, 2008 Share Posted February 19, 2008 When I run any query using mysql_query, if any error occured, I can get the error message from mysql_error(). Is there any similar function which will result success message. Quote Link to comment Share on other sites More sharing options...
Chris92 Posted February 19, 2008 Share Posted February 19, 2008 No, what you can do is write it yourself: <?php if( mysql_query("UPDATE `table` SET `field` = 'update' WHERE `field` = 'needs updated'") ) { echo "Successfully updated field"; } else { echo mysql_error(); } ?> Quote Link to comment Share on other sites More sharing options...
abdfahim Posted February 19, 2008 Author Share Posted February 19, 2008 the main problem with this is, for the following code REPLACE INTO `table1` SELECT * FROM `table2` WHERE CONDITION; I cant know how many rows has been updated. In phpmyadmin, if you run this query in any program like phpmyadmin, you will see this count how many rows has been updated. If there is no built-in function for this, I have write some other quiries to get that fegure. Quote Link to comment Share on other sites More sharing options...
PHP Monkeh Posted February 19, 2008 Share Posted February 19, 2008 You could take a look at : http://uk.php.net/manual/en/function.mysql-affected-rows.php 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.