Q:

Using UPDATE JOIN and database parameter

How can i write this code? 
$sorgu=$dbpdo->query("SELECT * FROM denetci_mahalle");

for ($i=0; $sorgu->rowCount(); $i++)
{
    $isletme=$dbpdo->prepare("
    UPDATE isletmeler
    JOIN denetci_mahalle
    ON isletmeler.adresi like '%'+@denetci_mahalle.mahalle+'%'
    SET isletmeler.sorumlu = denetci_mahalle.denetci
    ");
    $isletme->execute();

}

in this code '%'+@denetci_mahalle.mahalle+'%' is true? Pls help me.

A:

+  is not for concatenate string in PHP  if you need you could use . or better concat  .. and you con'y use @denetci_mahalle.mahall you hane not assign 
you should  use the result for $sorgu 
$sorgu=$dbpdo->query("SELECT * FROM denetci_mahalle");
 foreach ($sorgu  as $row) {

          $isletme=$dbpdo->prepare("
              UPDATE isletmeler
              JOIN denetci_mahalle
              ON isletmeler.adresi like concat('%','"  . $row['mahalle'] . "','%')  
              SET isletmeler.sorumlu = denetci_mahalle.denetci
              ");

       $isletme->execute();

  }

anyway you could avoid the foreach  just using  
   $isletme=$dbpdo->prepare("
              UPDATE isletmeler a
              JOIN denetci_mahalle  b 
              ON a.adresi like concat('%',  b.mahalle ,'%')  
              SET a.sorumlu = b.denetci
              ");
    $isletme->execute();

