Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts

    mysql_fetch_assoc

    PHP Code:
    $userM=$_SESSION['gid'];
    $checkMSG="SELECT id,recipient,subject,body,emailed,sender,unread,folder FROM gid_msg WHERE recipient='$userM'";
    $res=mysql_query(mysql_query);

    while(
    $fila mysql_fetch_assoc($res)) {
        echo 
    $fila["subject"];
     } 
    ERROR:
    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *********** on line 11

    My line 11 is:
    PHP Code:
    while($fila mysql_fetch_assoc($res)) { 
    What's wrong?
    Regards

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You should use die on this line
    PHP Code:
    $res=mysql_query(mysql_query) or die(mysql_error()); 
    and also you pass mysql_query to the mysql_query function which is incorrect. That line should be
    PHP Code:
    $res=mysql_query($checkMSG) or die(mysql_error()); 
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts
    all solved. Thanks


  •  

    Posting Permissions

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