View Full Version : Hide Warning massage in program !!
constantine 08-27-2005, 03:43 AM Hi !
My sql version is 4.1 and it seem OSticket isn't compatible with mysql 4.1 .
it work fine with this databse but it show this warning :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/yarantoo/public_html/support/class.ticket.php on line 283
How can I prevent to show this warning ?
laserlight 08-27-2005, 03:53 AM Change php.ini to set error_reporting to an appropriate level, or set on a page by page basis with error_reporting()
aashx 08-27-2005, 04:42 AM hello i tried like this.
x.php
<?
error_reporting(0);
trying to make error
echo "ok";
?>
This shows following output.
Parse error: syntax error, unexpected T_STRING in C:\localhost\friendsndates\x.php on line 6
my question :
why is it still showing error when i set error_reporting(0); ??
constantine 08-27-2005, 08:23 AM I add error_reporting(0); in file . but it show this warning again :(
constantine 08-27-2005, 08:34 AM Has it any configuration with htaccess ?
Burhan 08-27-2005, 09:16 AM It might be that you server settings do not allow you to over ride error_reporting.
Check with your server administrator.
Also check the value of display_errors
sasha 08-27-2005, 09:20 AM Rather then just hiding errors you should fix them. Check out the query in quustion and make it work. If that does not help try puting @ symbol in front of the function name. That will suppress wrarrnings / errros / notices of that function.
shoperotic 08-27-2005, 10:46 AM Parse error: syntax error, unexpected T_STRING in C:\localhost\friendsndates\x.php on line 6
This is a FATAL error, not a warning or a notice , your script execution is terminated and you cant hide that error, only with display_errors set to 0, but you will see a blank page instead.
check first the syntax at line 6, you maybe missed a comment or a ; , after that set the error_reporting to 0 .
mouldy_punk 08-27-2005, 11:11 AM Open /home/yarantoo/public_html/support/class.ticket.php
Go to line 283
Change mysql_query... to @mysql_query...
I think it's an @ you use...can't remember. Haven't used one before - but try it.
aashx 08-27-2005, 12:32 PM The line no 6 was intentionally kept error to test. i tried ini_set('display_errors',0); but its still shows error.
I want a bank page when there is any errors rather than php showing the error and line number.
error_reporting(0); is still not sloving this problem.
constantine 08-27-2005, 12:49 PM It error from this line :
$t = mysql_fetch_array(mysql_query("SELECT UNIX_TIMESTAMP($mysql_timestamp) AS timestamp"));
I changed mysql_query... to @mysql_query...
but it doesn't solve my problem .
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/yarantoo/public_html/support/class.ticket.php
PlanetJourney 08-27-2005, 12:58 PM Does it even connect to the database?
edit: ah sorry, missed that part. I see on their forum you're not the only one with this problem. If you can downgrade mysql, guess that's the only option.
aashx 08-27-2005, 01:33 PM $t = mysql_fetch_array(mysql_query("SELECT UNIX_TIMESTAMP($mysql_timestamp) AS timestamp"));
for the above i think you can modify like this to hide the error message but this will not affect on the working of your script. this will just hide the error
$t = @mysql_fetch_array(@mysql_query("SELECT UNIX_TIMESTAMP($mysql_timestamp) AS timestamp"));
I'm still waiting for my answer.
error_reporting(0);
is not hiding my error.
constantine 08-28-2005, 06:58 AM Thanks ,
change with this :
$t = @mysql_fetch_array(@mysql_query("SELECT UNIX_TIMESTAMP($mysql_timestamp) AS timestamp"));
my problem solve :)
aashx 08-28-2005, 12:26 PM My problem still not solved.
error_reporting(0);
is not hiding my error. why??
|