Feb
4

Whats is the difference between mysql_num_rows() and mysql_affected_rows()? mysql_num_rows() is used together with select statements while the mysql_affected_rows() is used with update, delete and insert statements.

An example of mysql_affected_rows().

$result = mysql_query( "INSERT INTO mysqltable
								VALUES( NULL, '$value' )" );
$rows = mysql_affected_rows();
// returns 1

Continue Reading →

© 2012 · Karl Sheen Blog · Sitemap · Proudly powered by Wordpress and Twitter Bootstrap · Icons by Glyphicons