Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2002 09:04:16 -0700
From:      Nathan Kinkade <nkinkade@dsl-only.net>
To:        "MET" <met@uberstats.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Off the Main Topic || Supplied argument is not a valid MySQL result resource
Message-ID:  <20020809090416.5a47f607.nkinkade@dsl-only.net>
In-Reply-To: <001801c23fbc$879e5f60$6701a8c0@SURVIVAL>
References:  <001801c23fbc$879e5f60$6701a8c0@SURVIVAL>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 9 Aug 2002 11:50:47 -0400
"MET" <met@uberstats.com> wrote:

> I realize that this is off topic, but I'm sending it to more specific
> PHP lists as well but none of them have such helpful people on them.
> 
> I'm getting some massive errors on some pretty simple code.  Included
> are the errors as well as the PHP function that is giving me issues.
> Any help would be greatly appreciated.  And the weirdest thing, is
> that the code used to work.... ??
> 
> Line 267 is equal to this PHP line:
> 	
> 	$RSM = mysql_fetch_array($resultm);
> 
> =============================
> ERRORS:
> =============================
> 
> Warning: Supplied argument is not a valid MySQL result resource in
> D:\Gunks\NewSite\phpAds\view.inc.php3 on line 267
<snip>
> CODE:
> =============================
> 
> function view_order($keywords, $id)
> {
>     global $phpAds_db, $phpAds_hostname, $phpAds_mysqluser,
> $phpAds_mysqlpassword, $REMOTE_HOST, $USER, $phpAds_tbl_banners;
<snip>
> mysql_connect($phpAds_hostname,$phpAds_mysqluser,$phpAds_mysqlpasswor
> d) or die("Unable to connect to database");
> 	@mysql_select_db("$phpAds_db") or die("Unable to select database
> $phpAds_db");
> 	
> 	if($USER[$id]["cbannerID"] == -1)
> 	{
> 		$sqlm = "SELECT MIN(bannerID), MAX(bannerID) FROM
> banners WHERE active='true';";
> 		
> 		$resultm = mysql_query($sqlm);
> 			
> 		$RSM = mysql_fetch_array($resultm);

This may be my own lack of knowledge on PHP, but what is the "@" symbol
before your call to mysql_select_db? I'm not familiar with that
construct in PHP, only PERL, but again, it may just be that I don't know
PHP well enough.  Also, are you sure that your query ($sqlm) is
returning any results?  Try checking for a result set with
mysql_num_rows before fetching the result array.  I see that you are
using the mysql_num_rows function at other places in your code.

Nathan

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020809090416.5a47f607.nkinkade>