$url= 'https://www.ozon.ru/api/composer-api.bx/_action/emailEntry';
$login = 'test@ya.ru';
$password = '12345';
$auth = 'email='.$login.'&password='.$password;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36');
curl_setopt($ch, CURLOPT_REFERER, 'https://ozon.ru');
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_COOKIEJAR,$_SERVER['DOCUMENT_ROOT'].'/cookie/cookiefile.txt');
// curl_setopt($ch, CURLOPT_POSTFIELDS, $auth);
curl_setopt($ch, CURLOPT_USERPWD, "test@ya.ru:12345");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
curl_setopt ($ch, CURLOPT_HTTPHEADER, array('Expect:'));
$result = curl_exec($ch);
echo $result;
curl_setopt($ch, CURLOPT_USERPWD, "test@ya.ru:12345");
и оставляю толькоcurl_setopt($ch, CURLOPT_POSTFIELDS, $auth);
{"error":"internal Server Error","traceID":"24b33531914544d5"}
curl_setopt($ch, CURLOPT_USERPWD, "test@ya.ru:12345");
$url= 'https://www.ozon.ru/api/composer-api.bx/_action/emailEntry';
$sql = "UPDATE `products` SET `stock`= 0";
$sql = "SELECT `date`, `date` - INTERVAL 1 DAY AS `prevDate`, `price_product` FROM `prices` WHERE `id_product` = ".$row_product['id_product']." ORDER BY `date` DESC";
<offer id="1">
<name>Эспандер</name>
<price>999.00</price>
</offer>
1 PRIMARY <derived3> NULL ALL NULL NULL NULL NULL 15585 11.11 Using where; Using filesort
1 PRIMARY prc NULL ref id_product,id_date id_date 306 t2.id_product,t2.dtp 1 100.00 NULL
1 PRIMARY n NULL ref id_product id_product 303 t2.id_product 1 100.00 NULL
3 DERIVED <derived5> NULL system NULL NULL NULL NULL 1 100.00 Using temporary; Using filesort
3 DERIVED p NULL ALL NULL NULL NULL NULL 2192 11.11 Using where
3 DERIVED p NULL ref id_product,id_date id_date 302 const 64 100.00 Using where; Using index
5 DERIVED p NULL ref id_product,id_date id_product 302 const 64 100.00 Using index
Далее из `pcalendar` через бессмысленный WHERE p.dt between p.dt AND CURDATE() берутся ВСЕ ЗАПИСИ таблицы `pcalendar`, к каждой БЕЗ каких-либо уcловий тупо добавляется id_product=..., и это результат внешнего запроса.
SELECT dtc, id_product, vendor, vendorCode, description, image_product, link_product, name, price_product,dtp
FROM (
SELECT t2.dtc, t2.id_product, n.name, prc.price_product, t2.dtp, n.vendor, n.vendorCode, n.description, n.image_product, n.link_product
FROM (
SELECT t1.dt AS dtc, t1.id_product, MAX(p.`date`) AS dtp
FROM (
SELECT p.dt, products.id_product
FROM pcalendar p, (
SELECT distinct p.id_product
FROM prices_test p
WHERE id_product = 837623465
ORDER BY id_product
) products
WHERE p.dt between p.dt AND CURDATE()
) t1
LEFT JOIN prices_test p ON (t1.dt >= p.`date`) AND (t1.id_product = p.id_product)
GROUP BY dtc, id_product
ORDER BY dtc, id_product
) t2
LEFT JOIN prices_test prc ON (t2.dtp = prc.`date`) AND (t2.id_product = prc.id_product)
LEFT JOIN products n ON (t2.id_product = n.id_product)
ORDER BY dtc, id_product
) t3
WHERE dtc between dtp AND CURDATE()
ORDER BY dtc DESC, id_product
CREATE TABLE `prices` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`id_product` BIGINT(21) NOT NULL DEFAULT '0',
`price_product` INT(11) NULL DEFAULT NULL,
`date` DATE NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `id_product` (`id_product`),
INDEX `id_date` (`id_product`, `date`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
ROW_FORMAT=COMPACT