Yang paham soal PHP masuk sini dong

Discussion in 'Desain Web dan Programming' started by Multyhost, 26 Feb 2015.

Thread Status:
Not open for further replies.
  1. Multyhost

    Multyhost Poster 2.0

    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    18
    assalamualaikum wr. wb.
    selamat siang warga DWH :)

    disini ada yang paham PHP gak? saya mau minta tolong ini cms saya error dan errornya kayak gini
    Lalu saya bedah dalemnya isinya kayak gini:
    Code:
    <td><div class="ewalet"><?
        $sbl=mysql_query("select * from transaksibulanan where status=1 order by id desc");
        $totin = 0;
        while($row=mysql_fetch_row($sbl)) {
            $totin = $totin + $row[3];
        }
        ?>
        <?
        $sbl=mysql_query("select * from transaksibulanan where status=0 order by id desc");
        $totout = 0;
        while($row=mysql_fetch_row($sbl)) {
            $totout = $totout + $row[3];
        }
        ?>
    [​IMG]

    Lalu apa yang harus saya lakukan ya untuk menangani error tersebut?
    Versi PHP di hosting 5.3 ini link ss versi PHP nya http://prntscr.com/69y3qu
     
  2. mustafaramadhan

    mustafaramadhan Hosting Guru

    Messages:
    3,237
    Likes Received:
    857
    Trophy Points:
    113
    Nilai 'order by id desc' untuk apa?.
     
  3. indra

    indra Apprentice 2.0

    Messages:
    567
    Likes Received:
    29
    Trophy Points:
    28
    kalau gini outputnya apa? sementara while nya di comment dulu
    PHP:
    $sbl=mysql_query...
    if (!
    $sbl) {exit(mysql_error());}
    itu kan error nya ada kasih tau "expects parameter 1 to be resource, boolean given" bahwa mysql_fetch_row() butuh 1 param resource sdgnkan $sbl nya berupa boolean.

    saran sih. skrg lbh baik pakai PDO. tapi kalau CMS yah apa boleh buat tunggu developer nya update
     
  4. kangdedes

    kangdedes Beginner 2.0

    Messages:
    20
    Likes Received:
    5
    Trophy Points:
    3

    Ikut nimbrung...
    Yakin database udah connected ?
     
  5. Multyhost

    Multyhost Poster 2.0

    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    18
    ini Tuan saya kasih ss lagi
    [​IMG]
     
  6. Multyhost

    Multyhost Poster 2.0

    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    18
    apakah itu ada tabel yang belum di isi di databasenya ya? ini cms custom / buatan sendiri
     
  7. Multyhost

    Multyhost Poster 2.0

    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    18
    database sudah nyambung Tuan
     
  8. kangdedes

    kangdedes Beginner 2.0

    Messages:
    20
    Likes Received:
    5
    Trophy Points:
    3
    table nya gak ada...
    cek koneksi ke database
    cek ada apa gak tablenya
    cek nama2 kolom, termasuk huruf besar kecilnya Tuan
     
  9. Multyhost

    Multyhost Poster 2.0

    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    18
    order by id desc
    digunakan untuk menentukan bulan dan tahun total data, itu nantinya tampilannya dropdown select
     
  10. Multyhost

    Multyhost Poster 2.0

    Messages:
    327
    Likes Received:
    3
    Trophy Points:
    18
    oo begitu to Tuan, coba saya cek dulu Tuan
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...