• 27-09-2022, 16:49:42
    #10
    var olan db'yi silip yeniden utf-8 general_ci yaratmamak için aşağıdaki komutları kullanabilirsin.

    mysql 5.5 ve üzeri için
    ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    mysql 5.5 altı için
    ALTER DATABASE database_name CHARACTER SET utf8 COLLATE utf8_general_ci;
    ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
  • 04-10-2022, 13:16:59
    #11
    We ❤️ Youtube
    MeteBeey adlı üyeden alıntı: mesajı görüntüle
    29. satırı

    public static $encoding = 'utf8';

    şeklinde değiştirip deneyebilir misin?
    Aynı şekilde karakter hatası oluşmakta yardımcı olur musunuz tekrar rica etsem

    <?php
    set_time_limit(0);
    ini_set('max_execution_time','0'); 
    ini_set('memory_limit','1000000000000M');
    
    $db = new PDO("mysql:host=localhost;dbname=xxxx", "xxxx", "xxxxxx");
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    
    function OzelKarakterTemizle($veri)
    {
    $veri =str_replace("`","",$veri);
    $veri =str_replace("=","",$veri);
    $veri =str_replace("&","",$veri);
    $veri =str_replace("%","",$veri);
    $veri =str_replace("!","",$veri);
    $veri =str_replace("#","",$veri);
    $veri =str_replace("<","",$veri);
    $veri =str_replace(">","",$veri);
    $veri =str_replace("*","",$veri);
    $veri =str_replace("And","",$veri);
    $veri =str_replace("'","",$veri);
    $veri =str_replace("chr(34)","",$veri);
    $veri =str_replace("chr(39)","",$veri);
    return $veri;
    }
    
    function instagram($username){
        $curl = curl_init();
        curl_setopt_array($curl, [
            CURLOPT_URL => "https://instagram-profile1.p.rapidapi.com/getprofile/".$username,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_ENCODING => "",
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => "GET",
            CURLOPT_HTTPHEADER => [
                "X-RapidAPI-Host: instagram-profile1.p.rapidapi.com",
                "X-RapidAPI-Key: xxxxxxxxxxxxxxxxxxxxxx"
            ],
        ]);
        $response = curl_exec($curl);
        curl_close($curl);
        $json = json_decode($response, true);
        return $json;   
    }
    
    $query = $db->query("SELECT * FROM instagram WHERE api='off' LIMIT 200");
    
    foreach($query->fetchAll() as $data){
            $username = $data["kullanici_adi"];
            $ID = $data["id"];
            $api = instagram($username);
            sleep(1);
            $follower = $api["followers"];
            $image = $api["profile_pic_url_hd_proxy"];
            $is_business = $api["is_business"];
            $is_verified = $api["is_verified"];
            $is_private = $api["is_private"];
            $category_name = $api["category_name"];
            $following = $api["following"];
            $bio = OzelKarakterTemizle($api["bio"]);
            $full_name = OzelKarakterTemizle($api["full_name"]);
            $media = $api["lastMedia"]["count"];
                $db->query("UPDATE instagram SET takipcisayisi='".$follower."', profilresmi='".$image."', is_business='".$is_business."', is_verified='".$is_verified."', is_private='".$is_private."', category_name='".$category_name."', following='".$following."', bio='".$bio."', media='".$media."', full_name='".$full_name."', api='on' WHERE kullanici_adi='".$username."'");
            $db->query("INSERT INTO instagram_log(instagram_id, takipcisayi, tarih) VALUES('".$ID."', '".$follower."', '".date('d-m-Y H:i')."')");
            }