Skip to content

Instantly share code, notes, and snippets.

@sriannamalai
Last active December 23, 2015 08:19
Show Gist options
  • Save sriannamalai/6607289 to your computer and use it in GitHub Desktop.
Save sriannamalai/6607289 to your computer and use it in GitHub Desktop.
Code to update data on two Tables based on their Hashes
<?php
$result = mysql_query("UPDATE table1 a, table2 b
SET b.user_id = a.user_id, b.user_site = a.user_site
WHERE a.hashes = b.hash");
if (!$result) {
die("ERROR: ".mysql_error());
} else {
echo "Successfully updated!<br /><br />";
print_r($result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment