Hi,
I'm trying to do an update on one table of a record, depending on a field in that table matching a field in an associated table.
I've tried this query, and continually get a mysql_error even after trying a few different variations.
Any suggestions? I may have the structure incorrect for doing the join.
mem_id is the auto increment field in user table and the matching record number in the user_data table
$sql_ud = "UPDATE user_data d, users u SET d.fname=$fname, d.mname=$mname, d.lname=$lname, d.addr1=$addr1, d.addr2=$addr2, d.city=$city, d.state=$state, d.zip=$zip, d.phone=$phone, d.dsp_pref=$dsp_pref WHERE u.user = '$affiliate' AND d.mem_id = u.mem_id ";
$result=mysql_query($sql_ud) or die(mysql_error);