Hi
I am new to MySQL and not too shure how can I update row form another table while cheking if logged in user is same:
`Telefonist='".$_SESSION["UserName"]."
And also I need to check if date is the same so It gets to right pearson on right date in a row:log.Datum=telefonisti_podaci.Datum
here I am trying to count all 1ones and enter sum to from table1 to table2 in specific place.
Code:
$sql_zapis_do30 = "UPDATE telefonisti_podaci
SET `Total tura do 30` = (Select COUNT(*) `Ture do 30` from log,telefonisti_podaci WHERE `Ture do 30` is not null AND `Ture do 30`=1 AND log.Datum=telefonisti_podaci.Datum )
WHERE `Telefonist`='".$_SESSION["UserName"]."'";
CustomQuery($sql_zapis_do30);
I get error:You can't specify target table 'telefonisti_podaci' for update in FROM clause
Thanks