Cheap Loan - Personal Finance - Mobile Phone Deals - Secured Loans - Loans

PDA

View Full Version : MySQL_query error need help


bozz3001
Feb 19th 2007, 2:25 am
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

ThomasNederman
Feb 19th 2007, 3:04 am
do you have the code used for this page ? Looks to me like you dont have a database connection...

vinodkv
Feb 19th 2007, 4:27 am
you have to post full code

bozz3001
Feb 19th 2007, 10:15 am
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;

sadcox66
Feb 19th 2007, 11:35 am
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.