0

I have constructed query as a String from different variables (I have also tried with prepare/execute method).

WHen I put that string into (query) i doesn't get any results. But when I print it on screen, than copy/paste it into code and run it again, query is executed without problem.

    $datumefekta = $row['datumefekta'];
      $dpo = $row['dpo'];
      $valpla = $row['valpla'];
      $prihod = $row['prihod'];
      $logname = $row['logname'];
      $datumknj = $row['datumknj'];
      $comp = $row['comp'];
      $referentFak = $logname." (".$comp.")";
      
      $quTest = "UPDATE BusinessFlow SET vremeSlanjaFE = '".$datumefekta."', referentFakt = '".$referentFak."', vremeFakturisanja = '".$datumknj."', sstatus = 'B' WHERE brojRacuna = '".$racun['brojRacuna']."'";

$sql->query($quTest); 
      $sql -> query("UPDATE BusinessFlow SET vremeSlanjaFE = '2020-11-12 00:00:00.0', referentFakt = 'username', vremeFakturisanja = '2020-11-12 09:06:27.0', sstatus = 'A' WHERE brojRacuna = '01/20162938'"); 
  • If there is no error, then there *is* no data to match the input variables. From what I can see, at least sstatus is different in the two queries – Your Common Sense Nov 25 '20 at 12:28
  • There is no error displayed, and rowCount() returns 0. Difference in sstatus is made after multiple attempts to discover the reason for non execution. – Milos Simonovic Nov 27 '20 at 17:34
  • I can only repeat what I said before: Enable error reporting. Make sure there is no error. Proceed to checking the input data and the data stored in the database. Everything in explained in the post linked at the top of your question. That's a standard routine. You cannot avoid it. there is no wizard who will tell you where the problem is. You've got to elaborate on that. – Your Common Sense Nov 27 '20 at 17:42

0 Answers0