Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

mysql errors

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  I Read the news today  
Author Message
webmaster18

External


Since: Sep 07, 2003
Posts: 5



(Msg. 1) Posted: Fri Dec 05, 2003 10:08 pm
Post subject: mysql errors
Archived from groups: alt>www>webmaster (more info?)

Hi,
I've run a php script that uses mysql databases without problems
on one server, but then I changed web hosts and installed it the same
way buy I get a lot of errors which are all derived from the
script not being able to interact with the database.
It finds the database and connects, but then can't do anything else.
When it uses a database on a different server, things work fine,
so I'm guessing it's just a mysql error and not the fault of the script.

I'd appreciate any suggestions on how to deal with this.

thank you,
David

 >> Stay informed about: mysql errors 
Back to top
Login to vote
brucie011

External


Since: Nov 28, 2003
Posts: 133



(Msg. 2) Posted: Sat Dec 06, 2003 4:14 pm
Post subject: Re: mysql errors [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

in post <news:bqrh89$s9v$1@daisy.noc.ucla.edu>
David Bruno said:

 > I've run a php script that uses mysql databases without problems
 > on one server, but then I changed web hosts and installed it the same
 > way buy I get a lot of errors which are all derived from the
 > script not being able to interact with the database.

what do the errors say?

--
brucie
06/December/2003 01:12:44 pm kilo<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: mysql errors 
Back to top
Login to vote
webmaster18

External


Since: Sep 07, 2003
Posts: 5



(Msg. 3) Posted: Sat Dec 06, 2003 4:14 pm
Post subject: Re: mysql errors [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

errors are:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result

Warning: mysql_free_result(): supplied argument is not a valid MySQL result


"brucie" <brucie01.TakeThisOut@bruciesusenetshit.info> wrote in message
news:bqrhkk$257oai$1@ID-117621.news.uni-berlin.de...
 > in post <news:bqrh89$s9v$1@daisy.noc.ucla.edu>
 > David Bruno said:
 >
  > > I've run a php script that uses mysql databases without problems
  > > on one server, but then I changed web hosts and installed it the same
  > > way buy I get a lot of errors which are all derived from the
  > > script not being able to interact with the database.
 >
 > what do the errors say?
 >
 > --
 > brucie
 > 06/December/2003 01:12:44 pm kilo<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mysql errors 
Back to top
Login to vote
brucie011

External


Since: Nov 28, 2003
Posts: 133



(Msg. 4) Posted: Sat Dec 06, 2003 5:02 pm
Post subject: Re: mysql errors [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

in post <news:bqri6a$sr9$1@daisy.noc.ucla.edu>
David Bruno said:

   >>> I've run a php script that uses mysql databases without problems
   >>> on one server, but then I changed web hosts and installed it the same
   >>> way buy I get a lot of errors which are all derived from the
   >>> script not being able to interact with the database.

  >> what do the errors say?

 > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
 > Warning: mysql_free_result(): supplied argument is not a valid MySQL result

doesn't it continue ... "resource in [whatever] on line [whatever]"?

your mysql_query() didn't return a result (except for false) and
mysql_fetch_array(false) doesn't make sense so you get the error. as you
don't get the error with the old db its probably not an error in your
SELECT so check to make sure your table/fields are setup identically to
your old database.

without setting up a db and a bit of php to test and experiment for
myself (i'm way too lazy) thats my best guess.

please don't toppost

How am I supposed to post my replies in a newsgroup?:
<a style='text-decoration: underline;' href="http://allmyfaqs.com/faq.pl?How_to_post" target="_blank">http://allmyfaqs.com/faq.pl?How_to_post</a>

--
brucie
06/December/2003 01:46:40 pm kilo<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mysql errors 
Back to top
Login to vote
webmaster18

External


Since: Sep 07, 2003
Posts: 5



(Msg. 5) Posted: Sat Dec 06, 2003 5:02 pm
Post subject: Re: mysql errors [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 >
 > your mysql_query() didn't return a result (except for false) and
 > mysql_fetch_array(false) doesn't make sense so you get the error. as you
 > don't get the error with the old db its probably not an error in your
 > SELECT so check to make sure your table/fields are setup identically to
 > your old database.

The script creates all the necessary fields in the database
All I do is just enter in the hostname, username, database name, and
password.
On one server it works, on one it doesn't. Does that provide any more
clues?<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mysql errors 
Back to top
Login to vote
davidvb3

External


Since: Nov 10, 2003
Posts: 272



(Msg. 6) Posted: Sat Dec 06, 2003 10:50 pm
Post subject: Re: mysql errors [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

David Bruno wrote:

 > errors are:
 >
 > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
 >
 > Warning: mysql_free_result(): supplied argument is not a valid MySQL result

You need to do some diagnostics. I think the problem is most likely to
have occurred before the functions above were called.

1. Find out for sure whether the mysql_query() call is returning true,
false or the resource. If it is false, you have a syntax error in your
PHP or an incorrect sql string.
2. Make sure that the setup of the database is exactly the same. Are you
sure that the username and pass are the same as on the old server, and
that they are correctly typed?
3. Do a PHP_info() to make sure that the version of PHP is the same and
that the server setup is the same in all the relevant areas. Find out if
register_globals is on/off and make sure that if it is off that it
doesn't break your script.
4. If the sql string is dynamically generated, echo the string out after
it is created to make sure that it is correct. You could double check by
copy/pasting it into phpmyadmin or equivalent to make sure that it
doesn't throw any errors. And remember not to use a semicolon in the sql
string.

Failing that, trawl the manual at PHP.net:
<a style='text-decoration: underline;' href="http://au.php.net/manual/en/function.mysql-query.php" target="_blank">http://au.php.net/manual/en/function.mysql-query.php</a>

Faily that, post here with the full code.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mysql errors 
Back to top
Login to vote
who

External


Since: Apr 29, 2004
Posts: 1010



(Msg. 7) Posted: Sun Dec 07, 2003 10:38 am
Post subject: Re: mysql errors [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"David Bruno" <webmaster DeleteThis @lowestdomains.info> wrote in message
news:bqrh89$s9v$1@daisy.noc.ucla.edu...
 > Hi,
 > I've run a php script that uses mysql databases without problems
 > on one server, but then I changed web hosts and installed it the same
 > way buy I get a lot of errors which are all derived from the
 > script not being able to interact with the database.
 > It finds the database and connects, but then can't do anything else.
 > When it uses a database on a different server, things work fine,
 > so I'm guessing it's just a mysql error and not the fault of the script.
 >
Without any details provided a rough guess would be - assuming you have kept
everything the same, is that your old host had register_globals set to on
and your new host has the latest php with register_globals defaulted to off.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: mysql errors 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Help with MySQL - hi i am building a site from my pc using APACHE/ and all that other stuff need a little help... Now i want to add some php stuff )INSTALLED AND WORKS( , but this needs mySQL )INSTALLED AND WORKS( how would i setup the databases (named: dbase) : before on...

mysql question - Ok I have a .sql file thats 30MB in my home dir... I need to use SSH to put it in the database because it wont work with doing it via phpmyadmin... Can anyone remind me what the line is again to do this via SSH? Thanks.... -- Viper http://www.zurax.co...

MySQL and PHP coding help - Hey all, I'm currently redesigning a website that a friend and I started about a year ago. It is a daily surf report so when choosing the best script/language to use for the new design, I asked in here and found that a mixture of PHP and MySQL would be a...

mySQL Question (i think) - Hi all, I was wondering if there was a script or program, perhaps using mySQL, that would allow me to show an active inventory on a website? The desired function would be having the inventory adjust itself and shows current inventory count on the..

MySQL and Text/textfile question - Doing a site for a client that will hold user information including the usual name/address/ect... and a resume. Going to use MySQL to keep track of things, but have a question about the resume/resume file. What would be the best way to store it? Store...
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]