Wrote code in class:

$strSql = "UPDATE ".$this->suppliers." SET `date_update_bitrix`=NOW(),`flag_1c_bitrix`=0 where id='".$resAr['id']."'"; echo $strSql; $res = $this->DB->Query($strSql); echo $strSql; 
Writes the first echo $strSql; and the following error occurs:
 UPDATE it_suppliers SET `date_update_bitrix`=NOW(),`flag_1c_bitrix`=0 where id='37' <table cellpadding="1" cellspacing="0" width="35%" bgcolor="#9C9A9C"> <tr> <td><table cellpadding="5" cellspacing="0" width="100%"> <tr> <td bgcolor="#FFFFFF" align="center"> <FONT face="Verdana, Arial, Helvetica, sans-serif" size="-1"> <font color="#FF0000"><b>DB query error.</b></font><br> Please try later. </font><br> </td> </tr> </table></td> </tr> </table> <br><br><br> 
If the query ('UPDATE it_suppliers SET date_update_bitrix = NOW (), flag_1c_bitrix = 0 where id = '37' ') is inserted into heidi, then it is executed without any problems. Connection to the database is coming. At first it is executed without problems select from the same table, but update with problems. UPD Request to the database is done next. in the component where the class object is called:

 global $DB; $DBHost = $DB->DBHost; $DBName = "1c"; $DBLogin = $DB->DBLogin; $DBPassword = $DB->DBPassword; $DB_1c = new CDatabase; if(!$DB_1c->Connect($DBHost, $DBName, $DBLogin, $DBPassword)) { if(file_exists($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/php_interface/dbconn_error.php")) { include($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/php_interface/dbconn_error.php"); } else { include($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/dbconn_error.php"); } die(); } $DB_1c->Query("SET NAMES 'utf8'"); $obCatalog = new CIBlock; $obCatalog->InitEx($NS, array( "IBLOCK_ID" => 1, "OFFERS_IBLOCK_ID" => 4, "DB" => $DB_1c, "DATE_LAST_IMPORT" => $dateLastImport )); $obCatalog->UpdateFrom_it_suppliers();// вот там вызов select без проблем , а update c "заглушкой" 

  • This is just a stub. Set the db_conn.php constants in the pipe and see what the error is specifically. - u_mulder
  • $ DBDebug = true; and see the error - jekaby
  • it is worth it when it is executed perfectly, when it is not being executed ... But it is necessary that it always be executed. No text error gives out, except the specified. This is not a connection to the Bitrix database, this is a connection to another database. I will describe in the problem. - NNN
  • Absolutely unclear comment on what is worth, what is being done. In the new code it is also unclear how the request occurs. - u_mulder
  • @ u_mulder, @ jekaby, can this "stub" occur due to lack of memory on the computer. I have a weak comp with 2GB of RAM. Just testing on Compressor Server. - NNN

1 answer 1

 $res = $DB->Query($strSql);