HOpefully fix the 118 update to convert sponsor_contacts to users_sponsor

This commit is contained in:
james 2009-10-20 19:40:55 +00:00
parent ac3f5f9eb4
commit e23149dccc

View File

@ -24,10 +24,10 @@ function db_update_118_post()
$active="yes";
}
//see if a user exists with this email
$uq=mysql_query("SELECT * FROM users WHERE username='".mysql_real_escape_string($r->email)."' AND year='$r->year'");
$uq=mysql_query("SELECT * FROM users WHERE (username='".mysql_real_escape_string($r->email)."' OR email='".mysql_real_escape_string($r->email)."') ORDER BY year DESC LIMIT 1"); // AND year='$r->year'");
if($r->email && $ur=mysql_fetch_object($uq)) {
$user_id=$ur->id;
echo "Using existing users.id=$user_id for award_contacts.id=$r->id because email address/year ($r->email/$r->year) matches\n";
echo "Using existing users.id=$user_id for award_contacts.id=$r->id because email address ($r->email) matches\n";
//update any info we have thats missing
$sqlset="";