I don't see any code to attach to the MySQL server and select the data base
you are using. This code might be in a part of the script you didn't show
us, but somewhere there should be something like

$db = mysql_connect(...);

Better yet,

$db = mysql_connect(...) or die("Unable to open data base!<br/>\n");

This might be in the including script, if any, since the error message shows
a suggestively-named file name.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341


> -----Original Message-----
> From: List [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 17, 2006 9:30 PM
> To: mysql@lists.mysql.com
> Subject: 'Not a valid MySQL result resource' error
>
> Hello,
>
> I'm running f.a.m.p, f =freebsd 4.7 and mysql is 3.23.52.
>
> Anyway, I inherited a website from someone else's server(I don't know
> what they we're running) but the admin section of the website
> generates
> this error iin the apache error log when trying to login( on
> the screen
> just takes you back to login saying invalid:
>
> <snip>
> [Tue Oct 17 19:10:08 2006] [error] PHP Warning:
> mysql_query(): supplied
> argument is not a valid MySQL-Link resource in
> /usr/local/apache/website/incoming/_includes/_page-specialeven
> tsnav.php
> on line 16
> [Tue Oct 17 19:10:08 2006] [error] PHP Warning:  mysql_fetch_array():
> supplied argument is not a valid MySQL result resource in
> /usr/local/apache/website/incoming/_includes/_page-specialeven
> tsnav.php
> on line 17
> [Tue Oct 17 19:10:08 2006] [error] PHP Warning:  mysql_num_rows():
> supplied argument is not a valid MySQL result resource in
> /usr/local/apache/website/incoming/_includes/_page-specialeven
> tsnav.php
> on line 20
> <end snip>
>
>
> code in question:
>
> <script language="javascript">
> <!--
> function focus(urlstring) {
>
> window.open(urlstring,"adFOCUS","width=700,height=580,scrollba
rs=yes,toolbar=no,location=no,resizable=no");
>
> }
> //-->
> </script>
>
> <div id="mainnav">
> <table width="180" border="0" cellpadding="0" cellspacing="0">
> <tr><td align='left'><img src='_elements/spacer-blank.gif' height='1'
> width='180' border='0'></td></tr>
> <tr><td align='center'><font class='section'><u>Special
> Events</u></font><br><br></td></tr>
> <tr><td align="center">
> <?     $x = "SELECT page_contents.title,page_contents.id FROM
> page_contents,page_sections WHERE page_contents.pagename =
> page_sections.pagename AND page_contents.display != 'N' AND
> page_sections.publicurl = '/specialevents.php' AND begdate <=
> Now() AND
> enddate > Now() ORDER BY rand() LIMIT 6";
>     $r = mysql_query($x,$db);
>     while ($re = mysql_fetch_array($r)) {
>         print "<a class=\"sideoff\"
> href=\"javascript:focus('http://www.website.com/viewevents.php
> ?rid=$re[id]')\">$re[title]</a><br><br>\n";
>
>     }
>     $rcount = mysql_num_rows($r);
>     if (($rcount == 6)) {
>         print "<a class=\"sideoff\"
> href='http://www.website.com/specialevents.php'>continued...</
> a><br><br>\n";
>
>     }
> ?>
> </td>
> </tr></table>
> </div>
>
>
> Any and all help is much appreciated, thanks.
>
> --
> Jason
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to