``
$p = file_get_contents('cos.txt', TRUE);
$plik = explode(",", $p);
$pytanie = "SELECT id_product
, description
, description_short
, name
FROM sklep_product_lang
WHERE id_shop
='2' and id_lang
='8' and id_product
in($p)";
if($w = $db->query($pytanie)){
while ($x = $w->fetch_array(MYSQLI_ASSOC))
{
$c[]=$x;
}
var_dump($c);
}
$question = "SELECT id_product, description, description_short, name
FROM sklep_product_lang
WHERE id_shop = '1' and id_lang = '8' and
description <> '".$c['description']."' and
description_short <> '".$c['description_short']."' and
name <> '".$c['name']."' and
id_product = '".$c['id_product']."' ";
if($q = $db->query($question)){
while ($z = $q->fetch_array(MYSQLI_ASSOC)){
}
}
if (is_array($e)){
foreach($e as $data){
$sql1 = "UPDATE sklep_product_lang SET
description = '".$data['description']."' and
description_short = '".$data['description_short']."' and
name = '".$data['name']."'
WHERE
description <> '".$data['description']."' and
description_short <> '".$data['description_short']."' and
name <> '".$data['name']."' and
id_product = '".$data['id_product']."'
id_shop = '1' and id_lang = '8' ";
$r = $db->query($sql1);
}}
}
$db->close();
}
?>
``
Witam zaczynam przygodę z bazami danych i już mam problem który nie daje mi spokoju, chciałbym porównać opisy z poszczególnych sklepów internetowych jednak nie wiem w czym tkwi problem. Proszę o wyrozumiałość i pomoc. Skrypt ma za zadanie wychwycić różnice po czym poprawić je.