// Выборка данных о компании
$query = "SELECT * FROM company WHERE user_id = $user_id AND id = $company_id";
$result = $conn->query($query);
<tr>
<th>Бренд шин</th>
<td><textarea><?= $company['tire_brand'] ?></textarea></td>
</tr>
// Установка кодировки перед выполнением запроса
$conn->set_charset('utf8mb4');
$query = "INSERT INTO company (user_id, tire_brand) VALUES ('$user_id', '$tire_brand')";
<div class="col-md-3">
<label class="form-label" for="tire_brand">Бренд шин:</label>
<textarea class="form-control" type="text" id="tire_brand" name="tire_brand"></textarea><br>
</div>
$sqlcomp = mysqli_query($link, 'SELECT `id` FROM `company`');
echo "{$product['id']}";
$myid = isset($_GET['view_id']) ? $product['id'] : '';
echo $myid;
$sql = mysqli_query($link, 'SELECT `ID`, `comment`, `id_comp`, `reg_date` FROM `tasks` `id_comp`=$myid;');
if (isset($_GET['view_id'])) {
$sql = mysqli_query($link, "SELECT `id`,
`cname`,
`cstatus`,
`cts`,
`ckonkurent`,
`cpay`,
`cmenedger`,
`cbrand`,
`csize`,
`cpayumov`,
`ccomment`,
`cemail`,
`cphone`,
`csite`,
`ccountry`,
`coffice`,
`cmname`,
`cmphone`,
`cmphone2`,
`reg_date`
FROM `company` WHERE `id`={$_GET['view_id']}");
$product = mysqli_fetch_array($sql);
}
<tr>
<td class="td-left">Назва компанії</td>
<td class="td-right"><?= isset($_GET['view_id']) ? $product['cname'] : ''; ?></td>
</tr>
$sql = mysqli_query($link, 'SELECT `ID`, `comment`, `id_comp`, `reg_date` FROM `tasks` `id_comp`=8;');
while ($result = mysqli_fetch_array($sql)) {
echo '<tr>' .
"<td>{$result['ID']}</td>" .
"<td>{$result['comment']}</td>" .
"<td>{$result['id_comp']}</td>" .
"<td>{$result['reg_date']}</td>" .
'</tr>';
}