From owner-freebsd-questions Fri Aug 9 8:47: 5 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE30537B401 for ; Fri, 9 Aug 2002 08:46:39 -0700 (PDT) Received: from mailout6.nyroc.rr.com (mailout6-1.nyroc.rr.com [24.92.226.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0A8543E9C for ; Fri, 9 Aug 2002 08:46:25 -0700 (PDT) (envelope-from met@uberstats.com) Received: from SURVIVAL (rrcs-nys-24-97-200-196.biz.rr.com [24.97.200.196]) by mailout6.nyroc.rr.com (8.11.6/RoadRunner 1.20) with ESMTP id g79FjuC14244 for ; Fri, 9 Aug 2002 11:45:56 -0400 (EDT) From: "MET" To: Subject: Off the Main Topic || Supplied argument is not a valid MySQL result resource Date: Fri, 9 Aug 2002 11:50:47 -0400 Message-ID: <001801c23fbc$879e5f60$6701a8c0@SURVIVAL> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0019_01C23F9B.008CBF60" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. ------=_NextPart_000_0019_01C23F9B.008CBF60 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 Warning: Supplied argument is not a valid MySQL result resource in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 269 Warning: Supplied argument is not a valid MySQL result resource in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 287 Warning: Supplied argument is not a valid MySQL result resource in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 289 Warning: Supplied argument is not a valid MySQL result resource in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 295 Warning: Supplied argument is not a valid MySQL result resource in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 297 less than one inside of nothing found. Warning: Undefined index: format in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 327 Warning: Undefined index: bannerID in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 Warning: Undefined index: bannerID in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 Warning: Undefined index: width in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 Warning: Undefined index: height in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 Warning: Undefined index: alt in D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 ============================= CODE: ============================= function view_order($keywords, $id) { global $phpAds_db, $phpAds_hostname, $phpAds_mysqluser, $phpAds_mysqlpassword, $REMOTE_HOST, $USER, $phpAds_tbl_banners; if(!isset($USER[$id]["cbannerID"])) $USER[$id]["cbannerID"] = -1; ############################################################# $text = explode("/", $keywords); $keywords = ""; $x = 0; foreach($text as $line) { if( $x == 0 ) { $keywords = "(keyword LIKE '%" . $line . "%'"; } else { $keywords = $keywords . " OR keyword LIKE '%" . $line . "%'"; } $x++; } $keywords .= ")"; ############################################################# mysql_connect($phpAds_hostname,$phpAds_mysqluser,$phpAds_mysqlpassword) 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); if( mysql_num_rows($resultm) < 1 ) { $num1 = rand(1, 100); } Else { $num1 = rand($RSM[0], $RSM[1]); } $sql = "SELECT bannerID,banner,format,width,height,alt,url FROM $phpAds_tbl_banners WHERE active = 'true' AND $keywords AND bannerID >= $num1 ORDER BY bannerID LIMIT 0,1;"; } else { $sql = "SELECT bannerID,banner,format,width,height,alt,url FROM $phpAds_tbl_banners WHERE active = 'true' AND $keywords AND bannerID > " . $USER[$id]["cbannerID"] . " ORDER BY bannerID LIMIT 0,1;"; } $result = mysql_query($sql); $RS = mysql_fetch_array($result); if( mysql_num_rows($result) < 1 ) { $sql2 = "SELECT bannerID,banner,format,width,height,alt,url FROM $phpAds_tbl_banners WHERE active = 'true' AND $keywords ORDER BY bannerID LIMIT 0,1;"; $result2 = mysql_query($sql2); $RS2 = mysql_fetch_array($result2); if( mysql_num_rows($result2) < 1 ) { echo "less than one inside of nothing found."; } Else { $USER[$id]["bannerID"] = $RS2["bannerID"]; $USER[$id]["banner"] = $RS2["banner"]; $USER[$id]["format"] = $RS2["format"]; $USER[$id]["width"] = $RS2["width"]; $USER[$id]["height"] = $RS2["height"]; $USER[$id]["alt"] = $RS2["alt"]; $USER[$id]["url"] = $RS2["url"]; $USER[$id]["cbannerID"] = $RS2["bannerID"]; } } Else { $USER[$id]["bannerID"] = $RS["bannerID"]; $USER[$id]["banner"] = $RS["banner"]; $USER[$id]["format"] = $RS["format"]; $USER[$id]["width"] = $RS["width"]; $USER[$id]["height"] = $RS["height"]; $USER[$id]["alt"] = $RS["alt"]; $USER[$id]["url"] = $RS["url"]; $USER[$id]["cbannerID"] = $RS["bannerID"]; } if($USER[$id]["format"] == "html") { echo "
" . $USER[$id]["banner"] . "
"; } else { echo "\"""; } //log_adview($USER[$id]["bannerID"]); } ------=_NextPart_000_0019_01C23F9B.008CBF60 Content-Type: text/plain; name="the_code.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="the_code.txt" function view_order($keywords, $id) { global $phpAds_db, $phpAds_hostname, $phpAds_mysqluser, = $phpAds_mysqlpassword, $REMOTE_HOST, $USER, $phpAds_tbl_banners; if(!isset($USER[$id]["cbannerID"])) $USER[$id]["cbannerID"] =3D -1; =09 ############################################################# $text =3D explode("/", $keywords); =09 $keywords =3D ""; =09 $x =3D 0; =09 foreach($text as $line) { if( $x =3D=3D 0 ) {=09 $keywords =3D "(keyword LIKE '%" . $line . "%'"; } else { $keywords =3D $keywords . " OR keyword LIKE '%" . $line . "%'"; } =09 $x++; } =09 $keywords .=3D ")"; =09 ############################################################# =09 mysql_connect($phpAds_hostname,$phpAds_mysqluser,$phpAds_mysqlpassword) = or die("Unable to connect to database"); @mysql_select_db("$phpAds_db") or die("Unable to select database = $phpAds_db"); =09 if($USER[$id]["cbannerID"] =3D=3D -1) { $sqlm =3D "SELECT MIN(bannerID), MAX(bannerID) FROM banners WHERE = active=3D'true';"; =09 $resultm =3D mysql_query($sqlm); =09 $RSM =3D mysql_fetch_array($resultm); if( mysql_num_rows($resultm) < 1 ) { $num1 =3D rand(1, 100); } Else { $num1 =3D rand($RSM[0], $RSM[1]); } =09 $sql =3D "SELECT bannerID,banner,format,width,height,alt,url FROM = $phpAds_tbl_banners WHERE active =3D 'true' AND $keywords AND bannerID = >=3D $num1 ORDER BY bannerID LIMIT 0,1;"; } else { $sql =3D "SELECT bannerID,banner,format,width,height,alt,url FROM = $phpAds_tbl_banners WHERE active =3D 'true' AND $keywords AND bannerID > = " . $USER[$id]["cbannerID"] . " ORDER BY bannerID LIMIT 0,1;"; } =09 $result =3D mysql_query($sql); =09 $RS =3D mysql_fetch_array($result); if( mysql_num_rows($result) < 1 ) { $sql2 =3D "SELECT bannerID,banner,format,width,height,alt,url FROM = $phpAds_tbl_banners WHERE active =3D 'true' AND $keywords ORDER BY = bannerID LIMIT 0,1;"; $result2 =3D mysql_query($sql2); =09 $RS2 =3D mysql_fetch_array($result2); if( mysql_num_rows($result2) < 1 ) { echo "less than one inside of nothing found."; } Else { $USER[$id]["bannerID"] =3D $RS2["bannerID"]; $USER[$id]["banner"] =3D $RS2["banner"]; $USER[$id]["format"] =3D $RS2["format"]; $USER[$id]["width"] =3D $RS2["width"]; $USER[$id]["height"] =3D $RS2["height"]; $USER[$id]["alt"] =3D $RS2["alt"]; $USER[$id]["url"] =3D $RS2["url"]; =09 $USER[$id]["cbannerID"] =3D $RS2["bannerID"]; } } Else { $USER[$id]["bannerID"] =3D $RS["bannerID"]; $USER[$id]["banner"] =3D $RS["banner"]; $USER[$id]["format"] =3D $RS["format"]; $USER[$id]["width"] =3D $RS["width"]; $USER[$id]["height"] =3D $RS["height"]; $USER[$id]["alt"] =3D $RS["alt"]; $USER[$id]["url"] =3D $RS["url"]; =09 $USER[$id]["cbannerID"] =3D $RS["bannerID"]; } =09 if($USER[$id]["format"] =3D=3D "html") { echo "
" . = $USER[$id]["banner"] . "
"; } else { echo "3D\"""; } =20 //log_adview($USER[$id]["bannerID"]); } ------=_NextPart_000_0019_01C23F9B.008CBF60 Content-Type: text/plain; name="errors.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="errors.txt" Warning: Supplied argument is not a valid MySQL result resource in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 267 Warning: Supplied argument is not a valid MySQL result resource in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 269 Warning: Supplied argument is not a valid MySQL result resource in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 287 Warning: Supplied argument is not a valid MySQL result resource in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 289 Warning: Supplied argument is not a valid MySQL result resource in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 295 Warning: Supplied argument is not a valid MySQL result resource in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 297 less than one inside of nothing found. Warning: Undefined index: format in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 327 Warning: Undefined index: bannerID in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 Warning: Undefined index: bannerID in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 Warning: Undefined index: width in D:\Gunks\NewSite\phpAds\view.inc.php3 = on line 333 Warning: Undefined index: height in = D:\Gunks\NewSite\phpAds\view.inc.php3 on line 333 Warning: Undefined index: alt in D:\Gunks\NewSite\phpAds\view.inc.php3 = on line 333 ------=_NextPart_000_0019_01C23F9B.008CBF60-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message