Login web ada pesan warning

Discussion in 'Desain Web dan Programming' started by andijoe, 26 Dec 2012.

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

    andijoe New Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Mas-mas, mbak-mbak, bapak-bapak saya minta tolong dengan script saya ni dulu2 udah berjalan ga masalah baru 3 hari ini bermasalah:

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/smpmdn/public_html/sis/koneksi.php on line 45

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/smpmdn/public_html/sis/koneksi.php on line 58

    beberapa tahun ga ada masalah lho, ini scriptnya:
    <?php
    ob_start("");
    session_start();
    function sqlnumrows($hasil)
    {
    return mysql_num_rows($hasil);
    }
    function doquery($query,$koneksi)
    {
    $h=mysql_query($query,$koneksi);
    return $h;
    }

    function sqlfetcharray($hasil)
    {
    return mysql_fetch_array($hasil);
    }

    function sqlaffectedrows($koneksi)
    {
    return mysql_affected_rows($koneksi);
    }
    function printmesg($errmesg)
    {
    if ($errmesg!="")
    {
    echo "<center><table cellspacing=2 cellpadding=2 ><tr valign=top> <td align=center style='font-size:8pt'><strong>".$errmesg ."</strong></td></tr></table></center>";
    }
    }
    //inisialisasi database
    $host="localhost";
    $user="smpmdn_sismdn";
    $pass="lunix";
    $database="smpmdn_sismadiun";

    $title="Sistem Informasi Akademik SMPN 2 Kota Madiun";
    $kotanya="Madiun";

    //konek
    $konek=@mysql_connect($host,$user,$pass) or die("Error : Database Encounter");
    @mysql_select_db($database,$konek) or die("Failed : Cannot Select Database");

    $sql_global_th="SELECT * FROM tb_idthajaran WHERE id='1'";
    $detail_global_th=mysql_query($sql_global_th);
    if($data_global_th=mysql_fetch_array($detail_global_th)) // line yang kena warning
    {
    $ddthajaran=$data_global_th["idthajaran"];

    $waktu=getdate();
    for ($q=2003;$q<=$waktu[year]+2;$q++)
    if($ddthajaran==$q)
    {$tahun_global=($q-1).'/'.$q;}
    }

    $sql_password_siswa="select * from tb_infonilai";
    $sql_password_siswa.=" where id='1'";
    $batas_sql_password_siswa=mysql_query($sql_password_siswa);
    if($data_infonilai_sql_password_siswa=mysql_fetch_array($batas_sql_password_siswa)) // line yang kena warning
    {
    $aktiflistmenu=$data_infonilai_sql_password_siswa[aktif];
    }
    ?>

    Mohon bantuannya please kenapa kok bisa dulu bisa ga ada masalah sekarang kok jadi bermasalah???? terus bagamana solusinya supaya ga bermasalah

    matur tengkiu sebelumnya
     
  2. arieonline

    arieonline Expert 1.0

    Messages:
    885
    Likes Received:
    127
    Trophy Points:
    43
    ada space pd $detail_globa l_th di baris:

    if($data_global_th=mysql_fetch_array($detail_globa l_th)) // line yang kena warning
     
  3. sigmabisnis

    sigmabisnis Hosting Guru Web Hosting (Company)

    Messages:
    2,181
    Likes Received:
    144
    Trophy Points:
    63
    Nah itu dia?? coba dibetulkan dulu (edit dan save), kemudian cek kembali, apakah masih ada error nya gak?
     
  4. andijoe

    andijoe New Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Sudah itu mas, tp masih sama aja tetep juga warningnya........ tolong donk please
     
  5. arieonline

    arieonline Expert 1.0

    Messages:
    885
    Likes Received:
    127
    Trophy Points:
    43
    warning-nya sama?
     
  6. andijoe

    andijoe New Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    sama di line yang sama juga
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...