TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 05-18-2009, 03:50 AM   #1 (permalink)
The Visitor
 
Join Date: May 2009
Posts: 2
Thanks: 0
vixxy is on a distinguished road
Default Preventing mysqli errors from showing

Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2003): Can't connect to MySQL server on 'mysql7.......' (111) in /home/....t/defaults/co.php on line 8
and
Warning: mysqli_query() [function.mysqli-query]: Couldn't fetch mysqli in /home/..../co.php on line 18

Anyway how i can prevent these errors from showing up my on my site? In my file (co.php), i have this:
PHP Code:
mysqli_report(MYSQLI_REPORT_OFF);
$dbcon = new mysqli($server,$user,$pass,$db); 
I have tried these various codes:
PHP Code:
if (!$dbcon) {
    die(
'Server Error');
}
if (
$dbcon->ping()) {
 die(
'Server Problem');
}
if (
mysqli_connect_error()) { die('Connect failed1'); } 
if (
mysqli_connect_errno()) { die('Connect failed2'); } 
and yet, none of them is currently able to make mysqli shut up when it cant connect
vixxy is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
modifying PHP.ini allworknoplay General 3 04-27-2009 02:50 PM
Muting errors in PHP5 Ross General 4 06-30-2008 03:13 PM
Exceptions and suppressing mysqli errors delayedinsanity Advanced PHP Programming 12 05-07-2008 07:27 PM
mysqli wGEric General 7 04-06-2008 06:00 PM
mysqli OOP interface introduction Matt83 General 4 12-22-2007 11:52 PM


All times are GMT. The time now is 06:03 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design