473,665 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1582
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('displa y_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******@hotma il.com> a écrit dans le message de news:
11************* ********@e56g20 00...legro ups.com...
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
993
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. Tks very much
13
2742
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 like this... On Error Resuse Next MyFoo 123 lngErrNum = Err.Number On Error Goto 0
17
5912
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; n < 100000; n++) mm(); timer2 = time(NULL); exectime = difftime(timer2, timer1);
13
2261
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> #include <string.h> int low_range(char symbol) ; int main(int argc, char **argv)
6
9690
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 tested and know that demon is running and then checket and found the /var/lib/mysql/mysql.sock file missing.
2
2267
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 the whole XML file. Only if I explicitely exclude subtrees/nodes with <xsl:template match="anExcludedNode" /> their content doesn't appear in the output. Is this the only way to do
9
1654
by: Olaf | last post by:
Hi, here the following test code #include <iostream> using namespace std; struct Foo { Foo() { cout << " Foo()\n"; }
1
1732
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 the end of the file and without it, it would run file. int ReadFromFile(int argc, char **argv) { // our file pointer, initialized at NULL FILE *fStream = NULL;
11
53101
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 of today. He is not alone in his thinking. Similarly, In July of 2008 IBM, Intel, Microsoft and Xerox announced that they were joining forces with Information Overload Research Group(http://www.iorgforum.org/) to combat one of the greatest...
0
8348
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,...
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6187
isladogs
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...
0
5660
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();...
0
4186
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...
1
2765
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
2
1761
bsmnconsultancy
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...

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.