Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34

Thread: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

  1. #21
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Heh. I saw that when he finally put it in PHP tags, but at that point I thought it was just a typo he made when posting the code.

    To avoid problems like that in the future, I would recomend that you get a syntax highlighter like PHP Eclipse. (Actually, PHP eclipse is a full IDE, not just a syntax highlighter.)
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  2. #22
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    Quote Originally Posted by allahverdi View Post
    umm. I think you all missed one thing.

    change this:

    Code:
    $row = mysql_fetch_array($result)
    to this:

    Code:
    $row = mysql_fetch_array($result, MYSQL_ASSOC)
    I'm thinking that's the problem, it has to be a problem with that line... otherwise the way he has it set up it would have die()d a long time ago

  3. #23
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    motormichael12, solved already ^^. Look at page 2

    I'm happy that i could help to you

  4. #24
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    Oh lol didn't notice there were other pages, sorry :O

    Anyway I am using that same function and had the error just yesterday and come on today to see someone else get it... weird :O

    Now if all you php/mysql scripting support could redirect your attention to my topic xD

  5. #25
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    If you want paste your code here and say the error. I think we can help you...

  6. #26
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

  7. #27
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Help me plz..........

    I HAVE THIS ERROR..

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\www\e-exam\proses_hapus2_group.php on line 13


    THIS MY CODING

    <?php
    session_start();
    include 'dbase.php';

    $group=$_GET['group'];

    session_register("group");
    $_SESSION["group"]=$group;

    //echo $_SESSION["id"]; exit;

    $sql=mysql_query("SELECT * FROM kumpulan WHERE group = '$group'");
    $record=mysql_fetch_array($sql, MYSQL_ASSOC);

    ?>

    <p>&nbsp;</p>
    <form name="form1" method="post" action="hapus_pasti_group.php">
    <p align="center" class="style1" style="font-weight: bold">ANDA PASTI UNTUK PADAM MAKLUMAT INI? </p>
    <p class="style1">&nbsp;</p>
    <table width="89" height="53" border="1" align="center">
    <tr>
    <td width="79" height="23" bgcolor="#990099"><div align="center" style="font-size: 14px; color: #FFFFFF"><span style="font-weight: bold">KOD PROGRAM </span></div></td>
    </tr>
    <tr>
    <td height="22"><?php echo $record["group"];?></td>
    </tr>
    </table>
    <div align="center"></div>
    <p align="center" class="style1">
    <label>
    <input name="btn_hapus" type="submit" id="btn_hapus" value="PADAM" onclick "return pasti()"/>
    </label>
    </p>
    <p align="right"><strong> MEDAYN SYSTEM </strong></p>
    <p><a href="delete_program.php"><img src="image/Set-02c-june.gif" width="58" height="40" border="0"></a></p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </form>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>


    ANYBODY CAN HELP ME

  8. #28
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    77
    Thanks
    16
    Thanked 7 Times in 6 Posts

    Default

    Code:
    $sql=mysql_query("SELECT * FROM kumpulan WHERE group = '$group'");
    Try splitting the above code into two lines.. Also try echoing your query itself to know what exactly it looks like

    Code:
    $query = "SELECT * FROM kumpulan WHERE group = '$group'";
    
    \\You can comment out the below line for later; Now use it just for testing
    
    echo $query;
    
    
    $sql=mysql_query($query);

  9. The Following User Says Thank You to borris83 For This Useful Post:

    medayn (04-12-2009)

  10. #29
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    after i try wif ur coding..
    im also hav a problem..


    SELECT * FROM kumpulan WHERE group = '-STANDBY-'
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\www\e-exam\proses_hapus2_group.php on line 19

  11. #30
    Join Date
    Apr 2009
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hai chriswattsuck

    Please remove this code .if you want to put the html code after the php with out using <html><head><body> tags u can directly use the <tabl> <tr>..tags at any where.

    at the begining of the page you should write php code only.try this.

    <?php
    /* Program: petdisplay.php
    * Desc: Displays all pets in selected category.
    * /
    ?>
    <html>
    <head><title>Pet Catalog</title></head>
    <body>

    Thanks & Regards
    anu

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •