Jump to content

Count and display specifically updated records not ALL records


OldWest

Recommended Posts

My script is finally working as intended, but I want to add some additional data results.

 

I am trying to resolve how I can display a count of ONLY the records updated by my query:

 

// START :: Query to replace matches
mysql_query("UPDATE orig_codes_1a AS a
  					   JOIN old_and_new_codes_1a AS b ON concat(a.orig_code_1, a.orig_code_2) = concat(b.old_code_1, b.old_code_2)
				   SET a.orig_code_1 = b.new_code_1,
                           a.orig_code_2 = b.new_code_2") or die(mysql_error());
// END :: Query to replace matches

 

In this query I count ALL records selection:

 

// START :: Create query to be displayed as final results of original codes table.
$result = mysql_query("SELECT * FROM orig_codes_1a") 
or die(mysql_error());  

 

I want to display a count on this part of the query:

 

....concat(a.orig_code_1, a.orig_code_2) = concat(b.old_code_1, b.old_code_2)....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.