473,406 Members | 2,404 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,406 software developers and data experts.

MySQL error reporting

How do I turn off MySQL error reporting? I set error_reporting(0); but
that doesn't seem to be working.
Mar 20 '07 #1
8 4997
Paul Furman wrote:
How do I turn off MySQL error reporting? I set error_reporting(0); but
that doesn't seem to be working.
That turns off PHP error reporting.

What problem are you having?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 20 '07 #2
Jerry Stuckle wrote:
Paul Furman wrote:
>How do I turn off MySQL error reporting? I set error_reporting(0); but
that doesn't seem to be working.

That turns off PHP error reporting.

What problem are you having?
Sorry for the slow reply. Any SQL error appears on the screen, and
sometimes that includes info I don't want included. Hmm, now that I
think of it that may be a built in error reporting system (I didn't
write all of this system). In any case is this a risk and is there a way
of turning it off? The worst case I recall was something like:

ERROR: unable to connect to the sever using user 'admin' and password
'mysectretpassword'

Ha ha, I made that up as I don't recall that one but I don't want
anything like that to happen again!
Mar 30 '07 #3
Paul Furman wrote:
Jerry Stuckle wrote:
>Paul Furman wrote:
>>How do I turn off MySQL error reporting? I set error_reporting(0);
but that doesn't seem to be working.

That turns off PHP error reporting.

What problem are you having?

Sorry for the slow reply. Any SQL error appears on the screen, and
sometimes that includes info I don't want included. Hmm, now that I
think of it that may be a built in error reporting system (I didn't
write all of this system). In any case is this a risk and is there a way
of turning it off? The worst case I recall was something like:

ERROR: unable to connect to the sever using user 'admin' and password
'mysectretpassword'

Ha ha, I made that up as I don't recall that one but I don't want
anything like that to happen again!
Preface the mysql_connect() call with an '@' character, i.e.

@mysql_connect(....);

This suppresses any error message for this function. Just be sure to
check the response.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 30 '07 #4
Jerry Stuckle wrote:
Paul Furman wrote:
>Jerry Stuckle wrote:
>>Paul Furman wrote:

How do I turn off MySQL error reporting? I set error_reporting(0);
but that doesn't seem to be working.
That turns off PHP error reporting.

What problem are you having?


Sorry for the slow reply. Any SQL error appears on the screen, and
sometimes that includes info I don't want included. Hmm, now that I
think of it that may be a built in error reporting system (I didn't
write all of this system). In any case is this a risk and is there a
way of turning it off? The worst case I recall was something like:

ERROR: unable to connect to the sever using user 'admin' and password
'mysectretpassword'

Ha ha, I made that up as I don't recall that one but I don't want
anything like that to happen again!


Preface the mysql_connect() call with an '@' character, i.e.

@mysql_connect(....);

This suppresses any error message for this function. Just be sure to
check the response.
Excellent, thank you!!!
Apr 2 '07 #5
Paul Furman wrote:
Jerry Stuckle wrote:
>Paul Furman wrote:
>>Jerry Stuckle wrote:
Paul Furman wrote:

How do I turn off MySQL error reporting? I set error_reporting(0);
but that doesn't seem to be working.

That turns off PHP error reporting.

What problem are you having?

Sorry for the slow reply. Any SQL error appears on the screen, and
sometimes that includes info I don't want included. Hmm, now that I
think of it that may be a built in error reporting system (I didn't
write all of this system). In any case is this a risk and is there a
way of turning it off? The worst case I recall was something like:

ERROR: unable to connect to the sever using user 'admin' and password
'mysectretpassword'

Ha ha, I made that up as I don't recall that one but I don't want
anything like that to happen again!

Preface the mysql_connect() call with an '@' character, i.e.

@mysql_connect(....);

This suppresses any error message for this function. Just be sure to
check the response.

Excellent, thank you!!!
Hmm, well I thought that was working but maybe just on the live server
not my home test version. Anyways I have a related question. Now I do
want to show at least part of the error, to prevent duplicate login
names, I set the 'unique' key on that field and tested, the test came
back like this *first section in red I'd like to show* the next part I'd
rather not:

--
*ERROR: Duplicate entry 'paul' for key 2* - INSERT INTO customer VALUES
(0, 'paul','paul', '', 'paul', 'p', '', '', '', 'CA', '', '',
'2007-04-24', 'no', '0', 'n', 'n', 'n' )

Thank you! Your registration has been completed!
--

And of course I'd want at a minimum to be able to note the error &
suppress my "thank you" message afterwards. That bit of code is simply:

query($query);
print "<p>Thank you! Your registration has been completed!</p>\n";

more like this:

query($query);
if (!$error){
print "<p>Thank you! Your registration has been completed!</p>\n";
}

Thanks for any ideas!

Paul

Apr 24 '07 #6
| And of course I'd want at a minimum to be able to note the error &
| suppress my "thank you" message afterwards. That bit of code is simply:
|
| query($query);
| print "<p>Thank you! Your registration has been completed!</p>\n";
|
| more like this:
|
| query($query);
| if (!$error){
| print "<p>Thank you! Your registration has been completed!</p>\n";
| }

have you tried something like:

if (@query($query) !== false)
{
//thanks
} else {
// handle the error
}
Apr 24 '07 #7
Paul Furman wrote:
Paul Furman wrote:
>Jerry Stuckle wrote:
>>Paul Furman wrote:
Jerry Stuckle wrote:
Paul Furman wrote:
>
>How do I turn off MySQL error reporting? I set error_reporting(0);
>but that doesn't seem to be working.
>
That turns off PHP error reporting.
>
What problem are you having?

Sorry for the slow reply. Any SQL error appears on the screen, and
sometimes that includes info I don't want included. Hmm, now that I
think of it that may be a built in error reporting system (I didn't
write all of this system). In any case is this a risk and is there a
way of turning it off? The worst case I recall was something like:

ERROR: unable to connect to the sever using user 'admin' and
password 'mysectretpassword'

Ha ha, I made that up as I don't recall that one but I don't want
anything like that to happen again!

Preface the mysql_connect() call with an '@' character, i.e.

@mysql_connect(....);

This suppresses any error message for this function. Just be sure to
check the response.

Excellent, thank you!!!

Hmm, well I thought that was working but maybe just on the live server
not my home test version. Anyways I have a related question. Now I do
want to show at least part of the error, to prevent duplicate login
names, I set the 'unique' key on that field and tested, the test came
back like this *first section in red I'd like to show* the next part I'd
rather not:

--
*ERROR: Duplicate entry 'paul' for key 2* - INSERT INTO customer VALUES
(0, 'paul','paul', '', 'paul', 'p', '', '', '', 'CA', '', '',
'2007-04-24', 'no', '0', 'n', 'n', 'n' )

Thank you! Your registration has been completed!
--

And of course I'd want at a minimum to be able to note the error &
suppress my "thank you" message afterwards. That bit of code is simply:

query($query);
print "<p>Thank you! Your registration has been completed!</p>\n";

more like this:

query($query);
if (!$error){
print "<p>Thank you! Your registration has been completed!</p>\n";
}

Thanks for any ideas!

Paul
Paul,

Not as easy - and a little bit user unfriendly, also.

Rather - check the result of the @mysql_query() insert. If it is false,
call mysql_errno() to get the error number.

Error code 1062 is a duplicate entry error. If you get that, the userid
already exists. If you get something else, you have a different problem.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 24 '07 #8
Thanks!

Jerry Stuckle wrote:
Paul Furman wrote:
>Paul Furman wrote:
>>Jerry Stuckle wrote:

Paul Furman wrote:

Jerry Stuckle wrote:
>
>Paul Furman wrote:
>>
>>How do I turn off MySQL error reporting? I set
>>error_reporting(0); but that doesn't seem to be working.
>>
>>
>That turns off PHP error reporting.
>>
>What problem are you having?
>
>
Sorry for the slow reply. Any SQL error appears on the screen, and
sometimes that includes info I don't want included. Hmm, now that I
think of it that may be a built in error reporting system (I didn't
write all of this system). In any case is this a risk and is there
a way of turning it off? The worst case I recall was something like:
>
ERROR: unable to connect to the sever using user 'admin' and
password 'mysectretpassword'
>
Ha ha, I made that up as I don't recall that one but I don't want
anything like that to happen again!
Preface the mysql_connect() call with an '@' character, i.e.

@mysql_connect(....);

This suppresses any error message for this function. Just be sure
to check the response.
Excellent, thank you!!!


Hmm, well I thought that was working but maybe just on the live server
not my home test version. Anyways I have a related question. Now I do
want to show at least part of the error, to prevent duplicate login
names, I set the 'unique' key on that field and tested, the test came
back like this *first section in red I'd like to show* the next part
I'd rather not:

--
*ERROR: Duplicate entry 'paul' for key 2* - INSERT INTO customer
VALUES (0, 'paul','paul', '', 'paul', 'p', '', '', '', 'CA', '', '',
'2007-04-24', 'no', '0', 'n', 'n', 'n' )

Thank you! Your registration has been completed!
--

And of course I'd want at a minimum to be able to note the error &
suppress my "thank you" message afterwards. That bit of code is simply:

query($query);
print "<p>Thank you! Your registration has been completed!</p>\n";

more like this:

query($query);
if (!$error){
print "<p>Thank you! Your registration has been completed!</p>\n";
}

Thanks for any ideas!

Paul

Paul,

Not as easy - and a little bit user unfriendly, also.

Rather - check the result of the @mysql_query() insert. If it is false,
call mysql_errno() to get the error number.

Error code 1062 is a duplicate entry error. If you get that, the userid
already exists. If you get something else, you have a different problem.


--
Paul Furman Photography
http://www.edgehill.net/1
Bay Natives Nursery
http://www.baynatives.com
Apr 24 '07 #9

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

Similar topics

16
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 " =@ " ?...
10
by: Peschtra | last post by:
Hello -- I am trying to write to a a MySql database using php, and I seem to be hitting a wall. I am attaching my php file in case someone can look at it. When I run it, I don't get any error...
110
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...
11
by: kennthompson | last post by:
Trouble passing mysql table name in php. If I use an existing table name already defined everything works fine as the following script illustrates. <?php function fms_get_info() { $result =...
7
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored...
3
by: marexposed | last post by:
I've got this error (see the path in last line) db=MySQLdb.connect(host='localhost',use_unicode = True, charset = "Windows-1251",user='root',passwd='12',db='articulos') File...
0
by: Gabriel Genellina | last post by:
En Thu, 17 Apr 2008 15:41:49 -0300, <marexposed@googlemail.comescribió: Looks like a configuration problem in MySQL itself, unrelated to Python. See the my.ini file in MySQL installation...
3
by: thesmithman | last post by:
Well, actually, I'm sure it's my code... I have a basic nested query: $query="INSERT INTO items (blah, blah, blah) VALUES ('$blah', '$blahblah', NULL)"; $result=mysql_query($query) or...
8
by: Stevebo | last post by:
I have installed PHP and MySQL using WAMP5 as my server on a Vista machine. I can run PHP scripts no problem. I can create and populate MySQL tables no problem. I cannot seem to get my PHP...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
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,...
0
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...
0
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...

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.