473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

avoid error output

Hello,

I've a file wich must answer a request. For this my file must generate an
XML output.

That's work fine but sometimes I get a wrong mysql query. In this case, I've
to manage the output message. Problem: the mysql error message is shown, so
the answer will have the mysql error then the XML output, and this don't
works for the "reading" script.

How to avoid tho show the mysql error when any ? I can't modify php.ini.

Thanks for answer.

Bob

Mar 1 '06 #1
4 1572
You can either append an "@" to the function, for example;
@mysql_connect, or turn off error reporting for the whole script by
adding these two lines to the top of your script.

ini_set('display_errors', 0);
error_reporting(0);

Mar 1 '06 #2
..oO(samudas)
You can either append an "@" to the function, for example;
@mysql_connect, or turn off error reporting for the whole script by
adding these two lines to the top of your script.


It would be better to check what caused the error and fix/handle it.

Micha
Mar 1 '06 #3
Micha;
That's true and i totally agree with you but in this case it doesn't
seem the app is broken. I guess it's broken in the sense that the
programmer isn't checking if a query result is valid. Just telling them
what they want to know. If it were my script i'd echo something useful
when a query result failed.

Mar 2 '06 #4
"samudas" <sa******@hotmail.com> a écrit dans le message de news:
11*********************@e56g2000cwe.googlegroups.c om...
Micha;
That's true and i totally agree with you but in this case it doesn't
seem the app is broken. I guess it's broken in the sense that the
programmer isn't checking if a query result is valid. Just telling them
what they want to know. If it were my script i'd echo something useful
when a query result failed.


Thanks for your answers.
I'm actually "answering" a remote script with XML code. id there is anything
else than xml datas (case of a mysql error or anything else), then the
script fails to create a good XML output and the answer is wrong.

I've to manage if the mysql server fails (I do check and return an error in
the XML message) instead of a message on the screen.

Thanks for your answer !

Bob

Mar 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gi?rgenes | last post by:
Hi, When I use, for example, PyRun_File to run a script and an error occur, the error is sent to stderr. What can I do to avoid it? To cleanly capture the error w/out it beeing sent to stderr....
13
by: Steve Jorgensen | last post by:
== On Error Resume next, and Err.Number == If you want to call one of your procedures from another procedure, and check for errors afterward, you mayimagine that you should write code something...
17
by: Pushkar Pradhan | last post by:
I want to time my matrix multiply code (in MFLOPS). I want to run the code 100,000 times or some other big number. This can be done 2 ways (for and while loops): timer1 = time(NULL); for(n = 0;...
13
by: Sameer | last post by:
Hi friends, I am beginner in C++. I am using g++ compiler. below is my code which gives error as " invlid conversion from 'char' to 'const char*' ..Plz help me with this. #include <iostream.h>...
6
by: Christian | last post by:
Hi, Trying to connect to the MySQL server I get the classic error message ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) I have...
2
by: trash.muell | last post by:
Hi, I am struggling with an XSLT task and need a hint: I have a complex XML file but want to only output some sub-trees of the XML structure. My XSLT script is always printing the information of...
9
by: Olaf | last post by:
Hi, here the following test code #include <iostream> using namespace std; struct Foo { Foo() { cout << " Foo()\n"; }
1
Andr3w
by: Andr3w | last post by:
Hi, I was working on something when I noticed that the following code produced a duplicate char before reaching at the end of the file if it had a blank line (with no chars at the file) before...
11
Niheel
by: Niheel | last post by:
http://bytes.com/images/howtos/information_overloaded.jpgPaul Graham wrote an interesting article a few months back about how the internet is leading to information overload for information workers...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.