By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,983 Members | 1,468 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,983 IT Pros & Developers. It's quick & easy.

avoid error output

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
..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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.