I am running a query to find out how many rows were affected by a query. What I need to be able to do is print out the actual records that were affected by the query. Can someone tell me why I get an error about it being an invalid resource? And tell me how I can get the records to print out?
Here is the code I wrote
// update status field
$sql3 = "UPDATE users INNER JOIN users_working USING (validation) SET users.status=users_working.status";
$r3 = mysql_query($sql3, $importer)or die("ERROR: ".mysql_error());
$row3 = mysql_affected_rows();
print "<br>UPDATED Records: ". $row3;
if ($row3>0){
//print out results
while ($row3 = mysql_fetch_array($row3)){
$firstname = $row3["fName"];
$lastname = $row3["lName"];
$validation = $row3["validation"];
$status = $row3["status"];
print("$firstname $lastname $validation $status");
}
}else{
// tell user there is no info
print("<br>Sorry, No Records were Updated.");
}