Решено! Проблема с большим SQL запросом

Тема в разделе "Программирование", создана пользователем Sonic, 09.10.2014.

  1. Offline

    Sonic Недавно здесь

    Регистрация:
    10.02.2008
    Сообщения:
    3
    Симпатии:
    0
    Пол:
    Мужской
    Здравствуйте, уважаемые форумчане.

    Я делаю парсер для Joomla и запись в БД решил сделать одним большим SQL запросом (из соображений производительности), но $db->query() возвращает false и в БД ничего не записывается, хотя если этот же запрос выполнить в PHPMyAdmin, то он выполняется без ошибок и записи добавляются нормально. Joomla ни на странице, ни в логах никаких ошибок не выводит (естественно в конфигах сервера отображение ошибок включено на максимум).

    Может быть кто-то уже работал ранее с длинными запросами в БД и сможет подсказать куда копать? Да и вообще как можно выяснить причину ошибки? Гуглил несколько статей по отладке запросов в БД Joomlы, но так и не смог ничего вывести.

    Запрос делаю конечно же через фрэймворк Joomlы.

    INSERT INTO `fhei_virtuemart_product_prices` (`virtuemart_product_price_id`,`virtuemart_product_id`,`product_price`,`product_currency`) VALUES ('5666','5666','643','131'), ('5667','5667','643','131'), ('5668','5668','643','131'), ('5669','5669','643','131'), ('5670','5670','643','131'), ('5671','5671','643','131'), ('5672','5672','643','131'), ('5673','5673','643','131'), ('5674','5674','643','131'), ('5675','5675','643','131'), ('5676','5676','643','131'), ('5677','5677','1010','131'), ('5678','5678','353','131'), ('5679','5679','405','131'), ('5680','5680','360','131'), ('5681','5681','405','131'), ('5682','5682','353','131'), ('5683','5683','405','131'), ('5684','5684','1300','131'), ('5685','5685','233','131'), ('5686','5686','698','131'), ('5687','5687','353','131'), ('5688','5688','388','131'), ('5689','5689','188','131'), ('5690','5690','353','131'), ('5691','5691','353','131'), ('5692','5692','353','131'), ('5693','5693','878','131'), ('5694','5694','878','131'), ('5695','5695','353','131'), ('5696','5696','405','131'), ('5697','5697','1010','131'), ('5698','5698','405','131'), ('5699','5699','1010','131'), ('5700','5700','328','131'), ('5701','5701','1010','131'), ('5702','5702','518','131'), ('5703','5703','878','131'), ('5704','5704','233','131'), ('5705','5705','1890','131'), ('5706','5706','218','131'), ('5707','5707','405','131'), ('5708','5708','878','131'), ('5709','5709','878','131'), ('5710','5710','405','131'), ('5711','5711','353','131'), ('5712','5712','1010','131'), ('5713','5713','568','131'), ('5714','5714','1010','131'), ('5715','5715','1010','131'), ('5716','5716','878','131'), ('5717','5717','405','131'), ('5718','5718','1890','131'), ('5719','5719','878','131'), ('5720','5720','1010','131'), ('5721','5721','1110','131'), ('5722','5722','353','131'), ('5723','5723','878','131'), ('5724','5724','353','131'), ('5725','5725','878','131'), ('5726','5726','1010','131'), ('5727','5727','880','131'), ('5728','5728','915','131'), ('5729','5729','1110','131'), ('5730','5730','878','131'), ('5731','5731','1278','131'), ('5732','5732','1010','131'), ('5733','5733','878','131'), ('5734','5734','405','131'), ('5735','5735','878','131'), ('5736','5736','878','131'), ('5737','5737','1278','131'), ('5738','5738','878','131'), ('5739','5739','878','131'), ('5740','5740','878','131'), ('5741','5741','878','131'), ('5742','5742','878','131'), ('5743','5743','1890','131'), ('5744','5744','353','131'), ('5745','5745','1110','131'), ('5746','5746','1110','131'), ('5747','5747','1110','131'), ('5748','5748','353','131'), ('5749','5749','878','131'), ('5750','5750','1110','131'), ('5751','5751','878','131'), ('5752','5752','878','131'), ('5753','5753','878','131'), ('5754','5754','353','131'), ('5755','5755','878','131'), ('5756','5756','878','131'), ('5757','5757','1010','131'), ('5758','5758','878','131'), ('5759','5759','1890','131'), ('5760','5760','878','131'), ('5761','5761','878','131'), ('5762','5762','1010','131'), ('5763','5763','878','131'), ('5764','5764','878','131'), ('5765','5765','878','131'), ('5766','5766','353','131'), ('5767','5767','878','131'), ('5768','5768','878','131'), ('5769','5769','878','131'), ('5770','5770','878','131'), ('5771','5771','1010','131'), ('5772','5772','360','131'), ('5773','5773','353','131'), ('5774','5774','1890','131'), ('5775','5775','685','131'), ('5776','5776','353','131'), ('5777','5777','878','131'), ('5778','5778','878','131'), ('5779','5779','1010','131'), ('5780','5780','1010','131'), ('5781','5781','1065','131'), ('5782','5782','1128','131'), ('5783','5783','353','131'), ('5784','5784','353','131'), ('5785','5785','878','131'), ('5786','5786','405','131'), ('5787','5787','878','131'), ('5788','5788','353','131'), ('5789','5789','353','131'), ('5790','5790','353','131'), ('5791','5791','878','131'), ('5792','5792','878','131'), ('5793','5793','233','131'), ('5794','5794','878','131'), ('5795','5795','878','131'), ('5796','5796','353','131'), ('5797','5797','353','131'), ('5798','5798','353','131'), ('5799','5799','353','131'), ('5800','5800','353','131'), ('5801','5801','353','131'), ('5802','5802','353','131'), ('5803','5803','353','131'), ('5804','5804','388','131'), ('5805','5805','388','131'), ('5806','5806','353','131'), ('5807','5807','405','131'), ('5808','5808','353','131'), ('5809','5809','353','131'), ('5810','5810','353','131'), ('5811','5811','353','131'), ('5812','5812','353','131'), ('5813','5813','405','131'), ('5814','5814','353','131'), ('5815','5815','353','131'), ('5816','5816','878','131'), ('5817','5817','1415','131'), ('5818','5818','1230','131'), ('5819','5819','1415','131'), ('5820','5820','868','131'), ('5821','5821','353','131'), ('5822','5822','405','131'), ('5823','5823','868','131'), ('5824','5824','908','131'), ('5825','5825','1195','131'), ('5826','5826','353','131'), ('5827','5827','953','131'), ('5828','5828','1153','131'), ('5829','5829','795','131'), ('5830','5830','353','131'), ('5831','5831','870','131'), ('5832','5832','1285','131'), ('5833','5833','405','131'), ('5834','5834','215','131'), ('5835','5835','1253','131'), ('5836','5836','878','131'), ('5837','5837','878','131'), ('5838','5838','878','131'), ('5839','5839','878','131'), ('5840','5840','878','131'), ('5841','5841','878','131'), ('5842','5842','878','131'), ('5843','5843','1890','131'), ('5844','5844','878','131'), ('5845','5845','878','131'), ('5846','5846','1010','131'), ('5847','5847','1328','131'), ('5848','5848','1010','131'), ('5849','5849','878','131'), ('5850','5850','878','131'), ('5851','5851','878','131'), ('5852','5852','878','131'), ('5853','5853','878','131'), ('5854','5854','878','131'), ('5855','5855','1010','131'), ('5856','5856','353','131'), ('5857','5857','353','131'), ('5858','5858','243','131'), ('5859','5859','1890','131'), ('5860','5860','1230','131'), ('5861','5861','425','131'), ('5862','5862','878','131'), ('5863','5863','878','131'), ('5864','5864','353','131'), ('5865','5865','878','131'), ('5866','5866','878','131'), ('5867','5867','878','131'), ('5868','5868','188','131'), ('5869','5869','248','131'), ('5870','5870','788','131'), ('5871','5871','215','131'), ('5872','5872','215','131'), ('5873','5873','248','131'), ('5874','5874','918','131'), ('5875','5875','408','131'), ('5876','5876','360','131'), ('5877','5877','363','131'), ('5878','5878','1108','131'), ('5879','5879','353','131'), ('5880','5880','353','131'), ('5881','5881','878','131'), ('5882','5882','353','131'), ('5883','5883','878','131'), ('5884','5884','1300','131'), ('5885','5885','868','131'), ('5886','5886','878','131'), ('5887','5887','878','131'), ('5888','5888','353','131'), ('5889','5889','878','131'), ('5890','5890','878','131'), ('5891','5891','1890','131'), ('5892','5892','640','131'), ('5893','5893','878','131'), ('5894','5894','878','131'), ('5895','5895','878','131'), ('5896','5896','1230','131'), ('5897','5897','878','131'), ('5898','5898','878','131'), ('5899','5899','878','131'), ('5900','5900','405','131'), ('5901','5901','878','131'), ('5902','5902','878','131'), ('5903','5903','353','131'), ('5904','5904','878','131'), ('5905','5905','878','131'), ('5906','5906','878','131'), ('5907','5907','353','131'), ('5908','5908','353','131'), ('5909','5909','1010','131'), ('5910','5910','388','131'), ('5911','5911','215','131'), ('5912','5912','878','131'), ('5913','5913','1230','131'), ('5914','5914','878','131'), ('5915','5915','878','131'), ('5916','5916','1230','131'), ('5917','5917','1445','131'), ('5918','5918','573','131'), ('5919','5919','1010','131'), ('5920','5920','1098','131'), ('5921','5921','1038','131'), ('5922','5922','1223','131'), ('5923','5923','1010','131'), ('5924','5924','280','131'), ('5925','5925','1010','131'), ('5926','5926','878','131'), ('5927','5927','515','131'), ('5928','5928','405','131'), ('5929','5929','1055','131'), ('5930','5930','685','131'), ('5931','5931','353','131'), ('5932','5932','505','131'), ('5933','5933','248','131'), ('5934','5934','353','131'), ('5935','5935','840','131'), ('5936','5936','188','131'), ('5937','5937','215','131'), ('5938','5938','663','131'), ('5939','5939','878','131'), ('5940','5940','353','131'), ('5941','5941','878','131'), ('5942','5942','353','131'), ('5943','5943','878','131'), ('5944','5944','353','131'), ('5945','5945','353','131'), ('5946','5946','878','131'), ('5947','5947','878','131'), ('5948','5948','353','131'), ('5949','5949','353','131'), ('5950','5950','353','131'), ('5951','5951','878','131'), ('5952','5952','353','131'), ('5953','5953','878','131'), ('5954','5954','353','131'), ('5955','5955','353','131'), ('5956','5956','353','131'), ('5957','5957','878','131'), ('5958','5958','633','131'), ('5959','5959','353','131'), ('5960','5960','353','131'), ('5961','5961','608','131'), ('5962','5962','608','131'), ('5963','5963','353','131'), ('5964','5964','608','131'), ('5965','5965','353','131'), ('5966','5966','935','131'), ('5967','5967','353','131'), ('5968','5968','353','131'), ('5969','5969','353','131'), ('5970','5970','353','131'), ('5971','5971','353','131'), ('5972','5972','353','131'), ('5973','5973','353','131'), ('5974','5974','353','131'), ('5975','5975','353','131'), ('5976','5976','353','131'), ('5977','5977','353','131'), ('5978','5978','353','131'), ('5979','5979','353','131'), ('5980','5980','173','131'), ('5981','5981','353','131'), ('5982','5982','353','131'), ('5983','5983','353','131'), ('5984','5984','353','131'), ('5985','5985','353','131'), ('5986','5986','353','131'), ('5987','5987','353','131'), ('5988','5988','353','131'), ('5989','5989','353','131'), ('5990','5990','353','131'), ('5991','5991','353','131'), ('5992','5992','353','131'), ('5993','5993','353','131'), ('5994','5994','213','131'), ('5995','5995','353','131'), ('5996','5996','353','131'), ('5997','5997','353','131'), ('5998','5998','353','131'), ('5999','5999','353','131'), ('6000','6000','353','131'), ('6001','6001','353','131'), ('6002','6002','353','131'), ('6003','6003','353','131'), ('6004','6004','353','131'), ('6005','6005','353','131'), ('6006','6006','353','131'), ('6007','6007','353','131'), ('6008','6008','353','131'), ('6009','6009','353','131'), ('6010','6010','353','131'), ('6011','6011','353','131'), ('6012','6012','353','131'), ('6013','6013','353','131'), ('6014','6014','353','131'), ('6015','6015','353','131'), ('6016','6016','353','131'), ('6017','6017','353','131'), ('6018','6018','353','131'), ('6019','6019','353','131'), ('6020','6020','353','131'), ('6021','6021','353','131'), ('6022','6022','353','131'), ('6023','6023','213','131'), ('6024','6024','353','131'), ('6025','6025','353','131'), ('6026','6026','353','131'), ('6027','6027','353','131'), ('6028','6028','353','131'), ('6029','6029','353','131'), ('6030','6030','353','131'), ('6031','6031','353','131'), ('6032','6032','353','131'), ('6033','6033','353','131'), ('6034','6034','353','131'), ('6035','6035','353','131'), ('6036','6036','353','131'), ('6037','6037','353','131'), ('6038','6038','173','131'), ('6039','6039','353','131'), ('6040','6040','353','131'), ('6041','6041','353','131'), ('6042','6042','353','131'), ('6043','6043','353','131'), ('6044','6044','353','131'), ('6045','6045','405','131'), ('6046','6046','233','131'), ('6047','6047','188','131'), ('6048','6048','218','131'), ('6049','6049','918','131'), ('6050','6050','360','131'), ('6051','6051','360','131'), ('6052','6052','355','131'), ('6053','6053','355','131'), ('6054','6054','355','131'), ('6055','6055','558','131'), ('6056','6056','558','131'), ('6057','6057','878','131'), ('6058','6058','233','131'), ('6059','6059','878','131'), ('6060','6060','218','131'), ('6061','6061','1300','131'), ('6062','6062','1010','131'), ('6063','6063','1010','131'), ('6064','6064','543','131'), ('6065','6065','878','131'), ('6066','6066','418','131'), ('6067','6067','698','131'), ('6068','6068','608','131'), ('6069','6069','860','131'), ('6070','6070','188','131'), ('6071','6071','745','131'), ('6072','6072','648','131'), ('6073','6073','1010','131'), ('6074','6074','648','131'), ('6075','6075','685','131'), ('6076','6076','1075','131'), ('6077','6077','925','131'), ('6078','6078','360','131'), ('6079','6079','1070','131'), ('6080','6080','353','131'), ('6081','6081','878','131'), ('6082','6082','878','131'), ('6083','6083','353','131'), ('6084','6084','1010','131'), ('6085','6085','878','131'), ('6086','6086','878','131'), ('6087','6087','300','131'), ('6088','6088','405','131'), ('6089','6089','1010','131'), ('6090','6090','353','131'), ('6091','6091','685','131'), ('6092','6092','353','131'), ('6093','6093','898','131'), ('6094','6094','488','131'), ('6095','6095','570','131'), ('6096','6096','880','131'), ('6097','6097','188','131'), ('6098','6098','878','131'), ('6099','6099','728','131'), ('6100','6100','533','131'), ('6101','6101','628','131'), ('6102','6102','878','131'), ('6103','6103','543','131'), ('6104','6104','405','131'), ('6105','6105','188','131'), ('6106','6106','353','131'), ('6107','6107','885','131'), ('6108','6108','878','131'), ('6109','6109','533','131'), ('6110','6110','788','131'), ('6111','6111','233','131'), ('6112','6112','353','131'), ('6113','6113','245','131'), ('6114','6114','1338','131'), ('6115','6115','1313','131'), ('6116','6116','1225','131'), ('6117','6117','1540','131'), ('6118','6118','1225','131'), ('6119','6119','1193','131'), ('6120','6120','1495','131'), ('6121','6121','1135','131'), ('6122','6122','1368','131'), ('6123','6123','1458','131'), ('6124','6124','1458','131'), ('6125','6125','1353','131'), ('6126','6126','1225','131'), ('6127','6127','1313','131'), ('6128','6128','1313','131'), ('6129','6129','1313','131'), ('6130','6130','1283','131'), ('6131','6131','1168','131'), ('6132','6132','1268','131'), ('6133','6133','1353','131'), ('6134','6134','1858','131'), ('6135','6135','1225','131'), ('6136','6136','1070','131'), ('6137','6137','1313','131'), ('6138','6138','1313','131'), ('6139','6139','1183','131'), ('6140','6140','1283','131'), ('6141','6141','1313','131'), ('6142','6142','1313','131'), ('6143','6143','1248','131'), ('6144','6144','1120','131'), ('6145','6145','1225','131'), ('6146','6146','1283','131'), ('6147','6147','1120','131'), ('6148','6148','1383','131'), ('6149','6149','1313','131'), ('6150','6150','1313','131'), ('6151','6151','1368','131'), ('6152','6152','1168','131'), ('6153','6153','1283','131'), ('6154','6154','1283','131'), ('6155','6155','1313','131'), ('6156','6156','1225','131'), ('6157','6157','1168','131'), ('6158','6158','1225','131'), ('6159','6159','1313','131'), ('6160','6160','1270','131'), ('6161','6161','1395','131'), ('6162','6162','1248','131'), ('6163','6163','1270','131'), ('6164','6164','1270','131'), ('6165','6165','2265','131'), ('6166','6166','1835','131'), ('6167','6167','1573','131'), ('6168','6168','850','131'), ('6169','6169','2720','131'), ('6170','6170','560','131'), ('6171','6171','1283','131'), ('6172','6172','865','131'), ('6173','6173','1133','131'), ('6174','6174','865','131'), ('6175','6175','588','131'), ('6176','6176','1988','131'), ('6177','6177','1948','131'), ('6178','6178','1073','131'), ('6179','6179','448','131'), ('6180','6180','708','131'), ('6181','6181','573','131'), ('6182','6182','1313','131'), ('6183','6183','1198','131'), ('6184','6184','490','131'), ('6185','6185','920','131'), ('6186','6186','1283','131'), ('6187','6187','588','131'), ('6188','6188','1233','131'), ('6189','6189','573','131'), ('6190','6190','1313','131'), ('6191','6191','1218','131'), ('6192','6192','1105','131'), ('6193','6193','530','131'), ('6194','6194','2303','131'), ('6195','6195','1120','131'), ('6196','6196','1913','131'), ('6197','6197','1368','131'), ('6198','6198','1328','131'), ('6199','6199','1035','131'), ('6200','6200','1368','131'), ('6201','6201','505','131'), ('6202','6202','530','131'), ('6203','6203','920','131'), ('6204','6204','1313','131'), ('6205','6205','425','131'), ('6206','6206','690','131'), ('6207','6207','475','131'), ('6208','6208','2848','131'), ('6209','6209','475','131'), ('6210','6210','2265','131'), ('6211','6211','490','131'), ('6212','6212','1225','131'), ('6213','6213','435','131'), ('6214','6214','1388','131'), ('6215','6215','850','131'), ('6216','6216','1623','131'), ('6217','6217','1178','131'), ('6218','6218','1955','131'), ('6219','6219','605','131'), ('6220','6220','1800','131'), ('6221','6221','588','131'), ('6222','6222','738','131'), ('6223','6223','1115','131'), ('6224','6224','805','131'), ('6225','6225','945','131'), ('6226','6226','678','131'), ('6227','6227','1110','131'), ('6228','6228','1218','131'), ('6229','6229','920','131'), ('6230','6230','1900','131'), ('6231','6231','880','131'), ('6232','6232','2185','131'), ('6233','6233','475','131'), ('6234','6234','1313','131'), ('6235','6235','865','131'), ('6236','6236','2375','131'), ('6237','6237','1313','131'), ('6238','6238','2293','131'), ('6239','6239','893','131'), ('6240','6240','1203','131'), ('6241','6241','518','131'), ('6242','6242','600','131'), ('6243','6243','1313','131'), ('6244','6244','1313','131'), ('6245','6245','920','131'), ('6246','6246','995','131'), ('6247','6247','893','131'), ('6248','6248','1328','131'), ('6249','6249','1058','131'), ('6250','6250','1058','131'), ('6251','6251','1058','131'), ('6252','6252','865','131'), ('6253','6253','1480','131'), ('6254','6254','995','131'), ('6255','6255','1105','131'), ('6256','6256','1105','131'), ('6257','6257','495','131'), ('6258','6258','865','131'), ('6259','6259','1283','131'), ('6260','6260','1115','131'), ('6261','6261','700','131'), ('6262','6262','503','131'), ('6263','6263','865','131'), ('6264','6264','655','131'), ('6265','6265','475','131'), ('6266','6266','1258','131'), ('6267','6267','2618','131'), ('6268','6268','945','131'), ('6269','6269','458','131'), ('6270','6270','1345','131'), ('6271','6271','1130','131'), ('6272','6272','1790','131'), ('6273','6273','790','131'), ('6274','6274','1373','131'), ('6275','6275','2070','131'), ('6276','6276','1110','131'), ('6277','6277','458','131'), ('6278','6278','573','131'), ('6279','6279','1720','131'), ('6280','6280','1028','131'), ('6281','6281','870','131'), ('6282','6282','500','131'), ('6283','6283','1295','131'), ('6284','6284','1105','131'), ('6285','6285','633','131'), ('6286','6286','633','131'), ('6287','6287','1790','131'), ('6288','6288','1980','131'), ('6289','6289','1553','131'), ('6290','6290','2070','131'), ('6291','6291','1373','131'), ('6292','6292','920','131'), ('6293','6293','1425','131'), ('6294','6294','610','131'), ('6295','6295','1275','131'), ('6296','6296','1790','131'), ('6297','6297','818','131'), ('6298','6298','1790','131'), ('6299','6299','1680','131'), ('6300','6300','778','131'), ('6301','6301','778','131'), ('6302','6302','1790','131'), ('6303','6303','920','131'), ('6304','6304','778','131') и далее ещё в два раза больше значений идёт
     
  2.  
  3. OlegM
    Онлайн

    OlegM Russian Joomla! Team Команда форума

    Регистрация:
    12.04.2007
    Сообщения:
    4 356
    Симпатии:
    370
    Пол:
    Мужской
    А ошибки при записи отлавливаешь типа
    Код (PHP):
    1. if($db->getErrorNum()){
    2. JError::raiseError("Error",$db->stderr());
    3. }


    И лучше бы выкладывал весь PHP-код с запросом.
     
    Sonic нравится это.
  4. Offline

    Sonic Недавно здесь

    Регистрация:
    10.02.2008
    Сообщения:
    3
    Симпатии:
    0
    Пол:
    Мужской
    Спасибо за код, вроде на подобный натыкался, но ничего не выводил, а ваш вывел ошибку, что сервер MySQL разорвал соединение. Спасибо!
    Подкрутил настройки MySQL и всё заработало. Тему можно закрывать.
     

Поделиться этой страницей

Загрузка...