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 4 1938
"David Bruno" <we*******@lowe stdomains.info> writes: 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 are the errors? Saying "I get a lot of errors" doesn't give
us much to analyze.
It finds the database and connects, but then can't do anything else.
How do you know the connection is successful? Does the code do
error checking? Is PHP configured to send errors to the browser?
If not, are you looking in the web server's error logs? See what
happens when you add the following lines to your script before
connecting to the database:
error_reporting (E_ALL);
ini_set('displa y_errors', True);
Errors can reveal Interesting Things to Bad Guys, so when you're
finished debugging it's usually a good idea to set display_errors
to False.
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.
Possibly. Have you verified that you have permission to connect
to the database and that you have the necessary privileges once
connected?
I'd appreciate any suggestions on how to deal with this.
Please post the exact error messages and the code that caused them.
That'll probably tell us what's wrong.
--
Michael Fuhr http://www.fuhr.org/~mfuhr/
> What are the errors? Saying "I get a lot of errors" doesn't give us much to analyze.
Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result
resource in /home/webzero/public_html/skijumping/global.inc.php on line 35
Warning: mysql_free_resu lt(): supplied argument is not a valid MySQL result
resource in /home/webzero/public_html/skijumping/global.inc.php on line 36
How do you know the connection is successful? Does the code do error checking? Is PHP configured to send errors to the browser?
Errors appear in the browser. Script has as setup.php file which
displays that is has connected to the database, but then
can't write any tables to it.
Possibly. Have you verified that you have permission to connect to the database and that you have the necessary privileges once connected?
I just have virtual hosting with cpanel 8.5. I create the database and
that's it. The script does all the set-up. How can I verifty or change
permissions.
Everything is chmod as the installation instructions say.
Thank you very much for your help.
-David
"David Bruno" <we*******@lowe stdomains.info> writes: What are the errors? Saying "I get a lot of errors" doesn't give us much to analyze.
Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result resource in /home/webzero/public_html/skijumping/global.inc.php on line 35
Warning: mysql_free_resu lt(): supplied argument is not a valid MySQL result resource in /home/webzero/public_html/skijumping/global.inc.php on line 36
It looks like mysql_query() is failing but the code isn't checking
for that failure. Modify your code to look like this:
$result = mysql_query($sq l)
or die("mysql_quer y() failed: " . htmlentities(my sql_error()));
For production you might want to handle the error more gracefully.
The message from mysql_error() should tell you what's wrong. If
you still can't figure out the problem, then please post some code
so we can see exactly what you're doing.
--
Michael Fuhr http://www.fuhr.org/~mfuhr/
"Michael Fuhr" <mf***@fuhr.org > wrote in message
news:3f******** **@omega.dimens ional.com... "David Bruno" <we*******@lowe stdomains.info> writes:
What are the errors? Saying "I get a lot of errors" doesn't give us much to analyze. Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL
result resource in /home/webzero/public_html/skijumping/global.inc.php on line
35 Warning: mysql_free_resu lt(): supplied argument is not a valid MySQL
result resource in /home/webzero/public_html/skijumping/global.inc.php on line
36 It looks like mysql_query() is failing but the code isn't checking for that failure. Modify your code to look like this:
$result = mysql_query($sq l) or die("mysql_quer y() failed: " . htmlentities(my sql_error()));
Do what michael says here. Also:
echo the query to screen right before you run it. Read it to see if it's
right. Maybe copy it and paste it into phpmyadmin or whatever else you use
to interact with the dB. Might yield more specific info This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Angelos |
last post by:
I've seen this in php.net $r=@mysql_query($query,$MySQL);
and I do not understand what would be the difference of this :
$r=mysql_query($query,$MySQL);
I mean what is the purpose of " =@ " ?
Does anyone know ? I am Just curious
Thanks
|
by: Lenz Grimmer |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
MySQL 4.0.14, a new version of the popular Open Source/Free Software
Database, has been released. It is now available in source and binary form
for a number of platforms from our download pages at
http://www.mysql.com/downloads/ and mirror sites.
|
by: jlee |
last post by:
I'm pretty much a newbie on mysql, and I need some help.
I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4
(i386) on a server hosting an active website.
The site's developer uses his own php shopping cart to receive customer
orders.
The configuration was done via cPanel with no external modifications -
which produced no protests when built, ran and connected with no
|
by: Bill Bevis |
last post by:
I'm trying to set up PHP 5.1.3 to run under Apache2, and talk to a
MySQL 5.0.21 database, and have been banging my head against a tough
install for days. I'm getting a slough of errors like this:
/usr/local/ssl/lib/libssl.a(ssl_sess.o)(.text+0xe60): In function
`SSL_SESSION_set_timeout':
: multiple definition of `SSL_SESSION_set_timeout'
/home/software/mysql-standard-5.0.21-linux-i686/lib/libmysqlclient.a(ssl.o)(.text+0x6d8):
first...
|
by: Vanessa |
last post by:
Hi there
I am an Access developer, and I have written applications for a 30
telephone call center, using the standard multiuser jet engine, it all
works fine, but I want to move our systems onto MySQL, as we get the
odd #DELETED# (that old chestnut) so that it is more stable, I have
installed mysql and myodbc and configured it in data sources (ODBC) and
it works fine (done the TEST).
But when I try to export a table from the mdb
| |
by: mpar612 |
last post by:
Hi everyone,
I'm not sure if this is asking too much or not. I am trying to get the
following PHP code to work on my website. It utilizes PHP 5, MySQL 4.1
and the PEAR DB module.
I am having issues retrieving data from the form. It won't retrieve
all of the data only a part of it. All of the code is below and I also
attached the code for the main file. I seem to understand everything
except for the last 40 or so lines of code,...
|
by: alf |
last post by:
Hi,
is it possible that due to OS crash or mysql itself crash or some e.g.
SCSI failure to lose all the data stored in the table (let's say million
of 1KB rows). In other words what is the worst case scenario for MyISAM
backend?
Also is it possible to not to lose data but get them corrupted?
|
by: cwho.work |
last post by:
Hi!
We are using apache ibatis with our MySQL 5.0 database (using innodb
tables), in our web application running on Tomcat 5. Recently we
started getting a number of errors relating to
java.sql.SQLException: Deadlock found when trying to get lock; Try
restarting transaction message from server: "Lock wait timeout
exceeded; try restarting transaction";
We get such errors generally on inserts or updates while applying a
|
by: menzies |
last post by:
Hi, I"m new to this forum, but I have been trying all day to install DBD::mysql onto my Intel MacBook. I've read lots of forums pages and none have gotten me to a successful 'make test' or a successful 'sudo make install.' Before every attempt I even do a sudo make distclean to make sure I haven't gotten things mucked up from a prior attempt.
OS: Mac OS X 10.4.10
MySQL: v5.0.41 for Mac OSX-i686
DBI: v1.58 (installed fine using CPAN)...
|
by: swethak |
last post by:
hi,
when i run a java program for to store data and retrive using mysql datatabse i got the following errors.I think in that one of error is due to set the class path.I placed my mysql-connector-java-3.0.11-stable-bin jar in lib directory.What is the command to set a classpath in windows for java mysql connectivity.plz tell that .And also how i avoid these errors.
import java.sql.*;
import java.util.*;
import java.net.*;
import...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |