i have two tables:
table 1 = userfiles table 2 = uploaded
Both tables have multiple columns but have one same column: Title ('ID's are different)
if i update the value of one userfiles.Title it should also update the value of the same uploaded.Title.
if(isset($_POST["btnSubmit"])){
$id = $_GET['id'];
$titlefield = $_REQUEST['titlefield'];
$Title = 'Title';
$errors = array();
$conn = mysqli_connect("localhost","root","12345","phpfiles");
$query = "UPDATE userfiles, uploaded
SET userfiles.$Title='$titlefield',
uploaded.$Title='$titlefield'
WHERE
userfiles.ID = '$id'
uploaded.title='$titlefield'";
$update2 = mysqli_query($conn, $query);
mysqli_close($conn);
$count = count($errors);
if($count != 0){
foreach($errors as $error){
echo $error."<br/>";
}
}
}
if i update (through php web form) userfiles.title(aaaaa) to 'ddddd' it should also update uploaded.title(aaaaa) to (ddddd)
but nothing gets updated