Help with the sql query, the data is written only in the first table, in the second - they do not want.

$q = "UPDATE users SET email='$email',flname='$flname',fllogin='$fllogin',country_code='$country_code' where pk_user = '$userkey'"; "UPDATE comments SET email='$email' where id_commenter='$userkey'"; 
  • one
    are you using php? ($ q) - Alexof
  • sql ........ - MaximPro

1 answer 1

 $q = "UPDATE users SET email='$email',flname='$flname',fllogin='$fllogin',country_code='$country_code' where pk_user = '$userkey'" + "UPDATE comments SET email='$email' where id_commenter='$userkey'"; 

or

 $q1 = "UPDATE users SET email='$email',flname='$flname',fllogin='$fllogin',country_code='$country_code' where pk_user = '$userkey'"; $q2 = "UPDATE comments SET email='$email' where id_commenter='$userkey'"; 

not?

  • rather, it should have been like this: $q = "UPDATE users SET email='$email',flname='$flname',fllogin='$fllogin',country_code='$country_code' where pk_user = '$userkey'; UPDATE comments SET email='$email' where id_commenter='$userkey'"; - jmu