MySQL_query error need help

Discussion in 'MySQL' started by bozz3001, Feb 19, 2007.

  1. #1
    My site should display some content on the index.php page but I get the following error....The rest of the site seems to work fine...Im looking for someone to help me solve this issue. PM me if you can help

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/bozz3001/public_html/includes/adminpaging.php on line 17
     
    bozz3001, Feb 19, 2007 IP
  2. ThomasNederman

    ThomasNederman Peon

    Messages:
    112
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    do you have the code used for this page ? Looks to me like you dont have a database connection...
     
    ThomasNederman, Feb 19, 2007 IP
  3. vinodkv

    vinodkv Peon

    Messages:
    183
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you have to post full code
     
    vinodkv, Feb 19, 2007 IP
  4. bozz3001

    bozz3001 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I have a database connection because the rest of the site works just fine links, contest, stats, etc..below is the first 18 lines of the adminpaging.php


    <?php
    
    class MySQLPagedResultSet
    {
    
      var $results;
      var $pageSize;
      var $page;
      var $row;
      
      function MySQLPagedResultSet($query,$pageSize,$cnx)
      {	
      	
        global $resultpage;
    	if(isset($_GET['resultpage'])) $resultpage = $_GET['resultpage'];
    	
        $this->results = mysql_query($query,$cnx);
        $this->pageSize = $pageSize;
    PHP:
     
    bozz3001, Feb 19, 2007 IP
  5. sadcox66

    sadcox66 Spirit Walker

    Messages:
    496
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #5
    a.) Is the rest of the site pure .html ? (Does the rest of the site use PHP and mysel ?)
    b.) Perhaps you have index.php and index.html
    c.) perhaps you did not setup the config.php or similar file.
    It certainly looks like $cnx is not initialized and the file you described above is
    included I guess into index.php

    d.) Open index.php and locate where this file is included.
    next add
    phpinfo(); directly below that line.
    You will see a bunch of variables at the bottom.
    make sure $cnx has a value...
    It may be wise to copy index.php to index2.php and view your debugging there
    You do not want others to see what your doing.
     
    sadcox66, Feb 19, 2007 IP