Activity Stream
48,167 MEMBERS
6705 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33
  1.     
    #1
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com

    Default MySQL Error

    Im installed some script but i get this errors


    Warning
    : mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/XXXXXXX/public_html/index.php on line 99

    line 99: while ($y=mysql_fetch_assoc($x))



    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/XXXXXXX/public_html/index.php on line 80

    Line 80:while ($y=mysql_fetch_assoc($x))

    same thing for line 51




    server php version is 5.2.13
    MySQL version is 5.1.46-log





    edit: more info

    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/xxxxxx/public_html/index.php on line 51

    (code in red is line 51)
    Code: 
              
            </script>
        </head>
        
        <body>
            <div id="fb-root"></div>
            <script>
              window.fbAsyncInit = function() {
                FB.init({appId: '48272f6b9a278d88b2ec480da8790513', status:  true, cookie: true,
                         xfbml: true});
              };
              (function() {
                var e = document.createElement('script'); e.async = true;
                e.src = document.location.protocol +
                  '//connect.facebook.net/en_US/all.js';
                document.getElementById('fb-root').appendChild(e);
              }());
            </script>
            
        <div id="header">
                <a href="index.php"  id="branding"><span>LikeItNow</span></a>
                <p id="total_pages" class="rounded"><span  id="count"> <? 
            $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT  0,1");
            $nr=0;
           while ($y=mysql_fetch_assoc($x)) {
                $id=$y['id'];
                $like=$y['like'];
                ?>
            
                  <?=$id?><? echo substr(0,44);?>
                  
             <?
        }
        ?></span> pages created</p>
            </div>
            
            <div id="page_details" class="rounded">
                <h2>Create a New Page</h2>
                <p id="character_count"><span  id="characters">50</span> characters available</p>
                <form method="POST" action="index.php">
                    <input type="text" name="like" class="comments"  maxlength="50" value="Type your page name here ...">
                    <p id="url"></p>
    
                <button id="create_button"  type="submit"></button>
                </form>
            </div>
    DEMO of the SCRIPT: HERE


    the its only 1 table in the Database.


    here is the whole Index.php file


    Code: 
    <? 
    include ("config.php");
    if ($_POST["like"]) {
        $like=$_POST["like"];
        mysql_query("INSERT INTO fblike VALUES(NULL, '$like', '1')");
        $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT 1");
        while ($y=mysql_fetch_assoc($x)){
    $id=$y['id'];
    }
        ?>
        <script type="text/javascript">  window.location.href="<?=$url_site?>like.php?id=<?=$id?>";</script>
        <?
    }
    ?>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
        <head>
            <title>Websie Title.</title>
    
            <link rel="stylesheet" href="styles.css">
            
            <script type="text/javascript"  src="js/jquery.js"></script>
            <script type="text/javascript"  src="js/jquery.corner.js"></script>
            <script type="text/javascript"  src="js/main.js"></script>
    
                
            </script>
        </head>
        
        <body>
            <div id="fb-root"></div>
            <script>
              window.fbAsyncInit = function() {
                FB.init({appId: '48272f6b9a278d88b2ec480da8790513', status:  true, cookie: true,
                         xfbml: true});
              };
              (function() {
                var e = document.createElement('script'); e.async = true;
                e.src = document.location.protocol +
                  '//connect.facebook.net/en_US/all.js';
                document.getElementById('fb-root').appendChild(e);
              }());
            </script>
            
        <div id="header">
                <a href="index.php"  id="branding"><span>LikeItNow</span></a>
                <p id="total_pages" class="rounded"><span  id="count"> <? 
            $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT  0,1");
            $nr=0;
           while ($y=mysql_fetch_assoc($x)) {
                $id=$y['id'];
                $like=$y['like'];
                ?>
            
                  <?=$id?><? echo substr(0,44);?>
                  
             <?
        }
        ?></span> pages created</p>
            </div>
            
            <div id="page_details" class="rounded">
                <h2>Create a New Page</h2>
                <p id="character_count"><span  id="characters">50</span> characters available</p>
                <form method="POST" action="index.php">
                    <input type="text" name="like" class="comments"  maxlength="50" value="Type your page name here ...">
                    <p id="url"></p>
    
                <button id="create_button"  type="submit"></button>
                </form>
            </div>
            
            <div id="popular_pages" class="rounded box_420">
                <h2>Most Popular Pages</h2>
                <ul>
                                        <? 
        $x=mysql_query("SELECT * FROM fblike ORDER BY hits DESC LIMIT  0,10");
        $nr=0;
        while ($y=mysql_fetch_assoc($x)) {
            $id=$y['id'];
            $like=$y['like'];
            ?>
            
                  <li><a href='like.php?id=<?=$id?>'><?  echo substr($like, 0,44);?></a><br>
                  </li>
             <?
        }
        ?>
                                </ul>
            </div>
            
            <div id="new_pages" class="rounded box_420">
                <h2>New Pages</h2>
                <ul>
                                         <? 
            $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT  0,10");
            $nr=0;
            while ($y=mysql_fetch_assoc($x)) {
                $id=$y['id'];
                $like=$y['like'];
                ?>
                
               <li><a href='like.php?id=<?=$id?>'><?  echo substr($like, 0,44);?></a><br></li>
                 <?
            }
            ?>
    
                                    
                </ul>
            </div>
            
                <p id="footer" class="rounded">LikeItNow &copy;  2010. LikeItNow is not related to Facebook</p>
    
        </body>
    </html>
    bxflow Reviewed by bxflow on . MySQL Error Im installed some script but i get this errors Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/XXXXXXX/public_html/index.php on line 99 line 99: while ($y=mysql_fetch_assoc($x)) Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/XXXXXXX/public_html/index.php on line 80 Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Moderator
    NewEraCracker's Avatar
    MySQL version?
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  4.     
    #3
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com
    5.1.46

    8char

  5.     
    #4
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    what is sum script? we need this info to fix this.

    Defendos BETA3 Released! Thread - Official Website

  6.     
    #5
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com
    its some facebook like script

  7.     
    #6
    Respected Member
    If this is still not working then try adding this line in front of the lines where it blows up so you can see the contents of $x.

    var_dump($x);
    Also showing s 10 lines in front and behind the actual error line could be helpful.

  8.     
    #7
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com
    that didn't work.

  9.     
    #8
    Respected Developer
    Website's:
    wrzc.org
    It's a custom script or a script we're not familiar with. It could be a hundred things. We need a lot more code. Either link us to the script or post the file here. We need to know what $x is earlier in the script. Ideally we'd need to know what tables it's trying to connect to and if the tables and fields exist.
    If it was vB or IPB fine as we have a copy of it but for this we need a lot more code to look at.
    Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic

    Huge list of Warez Sites and free Multiposter Templates

  10.     
    #9
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com
    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/xxxxxx/public_html/index.php on line 51

    (code in red is line 51)
    Code: 
              
            </script>
        </head>
        
        <body>
            <div id="fb-root"></div>
            <script>
              window.fbAsyncInit = function() {
                FB.init({appId: '48272f6b9a278d88b2ec480da8790513', status: true, cookie: true,
                         xfbml: true});
              };
              (function() {
                var e = document.createElement('script'); e.async = true;
                e.src = document.location.protocol +
                  '//connect.facebook.net/en_US/all.js';
                document.getElementById('fb-root').appendChild(e);
              }());
            </script>
            
        <div id="header">
                <a href="index.php" id="branding"><span>LikeItNow</span></a>
                <p id="total_pages" class="rounded"><span id="count"> <? 
            $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT 0,1");
            $nr=0;
           while ($y=mysql_fetch_assoc($x)) {
                $id=$y['id'];
                $like=$y['like'];
                ?>
            
                  <?=$id?><? echo substr(0,44);?>
                  
             <?
        }
        ?></span> pages created</p>
            </div>
            
            <div id="page_details" class="rounded">
                <h2>Create a New Page</h2>
                <p id="character_count"><span id="characters">50</span> characters available</p>
                <form method="POST" action="index.php">
                    <input type="text" name="like" class="comments" maxlength="50" value="Type your page name here ...">
                    <p id="url"></p>
    
                <button id="create_button" type="submit"></button>
                </form>
            </div>
    DEMO of the SCRIPT: HERE


    the its only 1 table in the Database.


    here is the whole Index.php file


    Code: 
    <? 
    include ("config.php");
    if ($_POST["like"]) {
        $like=$_POST["like"];
        mysql_query("INSERT INTO fblike VALUES(NULL, '$like', '1')");
        $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT 1");
        while ($y=mysql_fetch_assoc($x)){
    $id=$y['id'];
    }
        ?>
        <script type="text/javascript"> window.location.href="<?=$url_site?>like.php?id=<?=$id?>";</script>
        <?
    }
    ?>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
        <head>
            <title>Websie Title.</title>
    
            <link rel="stylesheet" href="styles.css">
            
            <script type="text/javascript" src="js/jquery.js"></script>
            <script type="text/javascript" src="js/jquery.corner.js"></script>
            <script type="text/javascript" src="js/main.js"></script>
    
                
            </script>
        </head>
        
        <body>
            <div id="fb-root"></div>
            <script>
              window.fbAsyncInit = function() {
                FB.init({appId: '48272f6b9a278d88b2ec480da8790513', status: true, cookie: true,
                         xfbml: true});
              };
              (function() {
                var e = document.createElement('script'); e.async = true;
                e.src = document.location.protocol +
                  '//connect.facebook.net/en_US/all.js';
                document.getElementById('fb-root').appendChild(e);
              }());
            </script>
            
        <div id="header">
                <a href="index.php" id="branding"><span>LikeItNow</span></a>
                <p id="total_pages" class="rounded"><span id="count"> <? 
            $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT 0,1");
            $nr=0;
           while ($y=mysql_fetch_assoc($x)) {
                $id=$y['id'];
                $like=$y['like'];
                ?>
            
                  <?=$id?><? echo substr(0,44);?>
                  
             <?
        }
        ?></span> pages created</p>
            </div>
            
            <div id="page_details" class="rounded">
                <h2>Create a New Page</h2>
                <p id="character_count"><span id="characters">50</span> characters available</p>
                <form method="POST" action="index.php">
                    <input type="text" name="like" class="comments" maxlength="50" value="Type your page name here ...">
                    <p id="url"></p>
    
                <button id="create_button" type="submit"></button>
                </form>
            </div>
            
            <div id="popular_pages" class="rounded box_420">
                <h2>Most Popular Pages</h2>
                <ul>
                                        <? 
        $x=mysql_query("SELECT * FROM fblike ORDER BY hits DESC LIMIT 0,10");
        $nr=0;
        while ($y=mysql_fetch_assoc($x)) {
            $id=$y['id'];
            $like=$y['like'];
            ?>
            
                  <li><a href='like.php?id=<?=$id?>'><? echo substr($like, 0,44);?></a><br>
                  </li>
             <?
        }
        ?>
                                </ul>
            </div>
            
            <div id="new_pages" class="rounded box_420">
                <h2>New Pages</h2>
                <ul>
                                         <? 
            $x=mysql_query("SELECT * FROM fblike ORDER BY id DESC LIMIT 0,10");
            $nr=0;
            while ($y=mysql_fetch_assoc($x)) {
                $id=$y['id'];
                $like=$y['like'];
                ?>
                
               <li><a href='like.php?id=<?=$id?>'><? echo substr($like, 0,44);?></a><br></li>
                 <?
            }
            ?>
    
                                    
                </ul>
            </div>
            
                <p id="footer" class="rounded">LikeItNow &copy; 2010. LikeItNow is not related to Facebook</p>
    
        </body>
    </html>

  11.     
    #10
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    lol your Query is wrong

    PHP Code: 
    $x mysql_query('SELECT * FROM fblike ORDER BY id DESC LIMIT  0,1');

    //Try dump out whit it is, using the code below
    var_dump($x); //See if it comes back as a resource. 
    if it returns (bool) false then the table fblike does not exists or the column id does not exist.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MySQL Error
    By KINGTHE_ALI in forum Webmaster Discussion
    Replies: 4
    Last Post: 17th Nov 2011, 05:40 PM
  2. Database error-mysql error
    By saini in forum vBulletin
    Replies: 8
    Last Post: 8th Nov 2011, 06:54 AM
  3. MYSQL Error while Import via MYSQL Dumper (Error
    By desibreaker in forum Server Management
    Replies: 10
    Last Post: 5th Aug 2011, 07:26 PM
  4. MySQL Error
    By II AnDo II in forum Web Application/Script Support
    Replies: 2
    Last Post: 17th Aug 2009, 08:45 PM
  5. MySQL error
    By mash-e1 in forum Webmaster Discussion
    Replies: 2
    Last Post: 28th Mar 2009, 12:12 PM

Tags for this Thread

BE SOCIAL