Re: mysql/php query problem really bugging me
| From: | David Robley | Date: | Wed, 07 Aug 2002 00:28:43 +0000 |
| Subject: | Re: mysql/php query problem really bugging me | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21030@lists.php.net to get a copy of this message | ||
In article <OF35D9AFC9.D90D532B-ON88256C0D.007D2B89-
88256C0D.007D7478@simrad.no>, chip.wiegand@simrad.com says...
> Jason Wong <phplist@gremlins.com.hk> wrote on 08/06/2002 01:59:39 PM:
>
> > On Wednesday 07 August 2002 04:51, chip.wiegand@simrad.com wrote:
> > > I have a database and several tables on a mysql server maintained by my
> > > ISP. I have set up another
> > > mysql/php/apache server in my office. I have copied the
> database/tables/web
> > > pages from the ISP's
> > > server onto my server. Everything works great on my own server except
> the
> > > queries to one particular
> > > table. Here is the error I am getting:
> > >
> > > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result
> > > resource in
> > > /usr/local/apache/htdocs/bulletin_out.php on line 22
> > >
> > > This same page works fine on the ISP's server, but my copy is not
> working
> > > on my server.
> > Have you performed the obvious debugging procedures (like printing out
> the key
> > variables to ensure that they contain what you expect)?
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> I'm not sure how to do that on a page with no <form>, just html <a href>
> links.
> The url does appear to be correct -
> http://157.237.65.118/bulletin_sorter.php?orderby=vlad
> The above should select only the bulletins authored by Vlad, and it does
> work on
> the ISP's server, but not on my server.
> I noticed the ISP is running MySQL-3.23.26 and I'm running 3.23.51, if that
> makes
> any differance.
Well, you could try echoing $orderby, to see if the value is being passed
as you expect; odds are that you are being bitten by the register_globals
setting that has been mentioned here a bit lately.
Also, using mysql_error to see if there is a problem with the query
actually passed to mysql is a valuable debugging tool.
--
David Robley
Temporary Kiwi!
Quod subigo farinam