There is any way to update two tables in one query? Below is an example of my code. How can I put those two update queries in one? Thank you in advance!
<?php
// DATABASE UPDATE
if (isset($_POST['submit']) or isset($_GET['submit'])){
// 1st QUERY
$db =& JFactory::getDBO();
$query_1 = "UPDATE table_1
SET name = '".$_POST["name"]."',
surename = '".$_POST["surename"]."'
WHERE id=1";
$db->setQuery($query_1);
$db->query();
// 2nd QUERY
$db =& JFactory::getDBO();
$query_2 = "UPDATE table_2
SET team_id = '".$_POST["team_id"]."',
SET team_name = '".$_POST["team_name"]."'
";
$db->setQuery($query_2);
$db->query(); } ?>