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;
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>
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 "заглушкой"
db_conn.php
constants in the pipe and see what the error is specifically. - u_mulder