• 30-11-2018, 20:24:57
    #1
    Hat Kodu

    Alıntı
    PHP Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home3/vf0evvjx/public_html/xxx.com/xxx/wallpaper2u_home.php:399
    Stack trace:
    #0 /home3/vf0evvjx/public_html/xxxx.com/xxx/wallpaper2u_home.php(54): getCategories('Categories')
    #1 {main}
    thrown in /home3/vf0evvjx/public_html/xxxx.com/xxxx/wallpaper2u_home.php on line 399
    wallpaper2u_home.php on line 399

    Alıntı
    function getCategories($table_name_categories)
    {


    $home=new Home();


    $categories = [];

    $query_categories = "SELECT * FROM $table_name_categories";
    $result_categories=mysql_query($query_categories) OR die(mysql_error());


    // Loop through query and push results into $data;
    while ($row = mysql_fetch_assoc($result_categories)) {

    array_push($categories, [
    'id' => $row['id'],
    'title' => $row['title'],
    'image' => $row['image']

    ]);


    }

    $home -> categories=$categories;

    $home -> code="202";
    $home -> message="Data get Successfully";

    $user_result = json_encode($home);
    echo "$user_result";

    }
    Merhaba Beyler,

    Yukarıdaki gibi bir hata alıyorum, Çözmeme yardım edecek birileri varmı
  • 30-11-2018, 20:29:38
    #2
    function getCategories($table_name_categories)
    {
    
    
    $home=new Home();
    
    
    $categories = [];
    
    $query_categories = "SELECT * FROM $table_name_categories";
    $result_categories = mysql_query($query_categories) OR die(mysql_error());
    
    
    // Loop through query and push results into $data;
    while ($row = mysql_fetch_assoc($result_categories)) {
    
    array_push($categories, [
    'id' => $row['id'],
    'title' => $row['title'],
    'image' => $row['image']
    
    ]);
    
    
    }
    
    $home -> categories=$categories;
    
    $home -> code="202";
    $home -> message="Data get Successfully";
    
    $user_result = json_encode($home);
    echo "$user_result";
    
    }
    bu şekilde denermisin
  • 30-11-2018, 20:31:48
    #3
    [30-Nov-2018 11:30:34 America/Chicago] PHP Fatal error:  Uncaught Error: Call to undefined function mysql_query() in /home3/vf0evvjx/public_html/xxx.com/xxxx/wallpaper2u_home.php:399
    Stack trace:
    #0 /home3/vf0evvjx/public_html/xxx.com/xxxx/wallpaper2u_home.php(54): getCategories('Categories')
    #1 {main}
      thrown in /home3/vf0evvjx/public_html/xxx.com/xxxx/wallpaper2u_home.php on line 399
    Aynı hatayı almaya devam ediyorum
  • 30-11-2018, 22:51:39
    #4
    pdo kullanın
  • 30-11-2018, 22:53:26
    #5
    dev
    Kurumsal Üye
    mersinstyle adlı üyeden alıntı: mesajı görüntüle
    Hat Kodu

    wallpaper2u_home.php on line 399

    Merhaba Beyler,

    Yukarıdaki gibi bir hata alıyorum, Çözmeme yardım edecek birileri varmı
    PHP surumunuz ile alakali bir durum. PHP 7 ve uzerinde mysql_* fonksiyonlari kaldirildi.
  • 01-12-2018, 14:07:53
    #7
    Kimlik doğrulama veya yönetimden onay bekliyor.
    PHP sürümünüz kullandığınız yazılıma göre biraz fazla güncel hocam

    5.5 ile birlikte mysql metodlarına olan destek kesildi, php 7 ile tamamen kaldırıldı.

    detayları aşağıda görebilirsiniz.

    https://wiki.php.net/rfc/remove_depr..._php7#extmysql
  • 01-12-2018, 14:58:36
    #8
    Yani PHP sürümünü düşürümem gerek doğrumudur ?