You are here: Re: Error Reporting - Where to Start? « All PHP « IT news, forums, messages
Re: Error Reporting - Where to Start?

Posted by Tom on 07/31/07 17:16

On Mon, 30 Jul 2007 21:19:41 GMT, GA wrote...
>
>On Mon, 30 Jul 2007 20:44:02 +0200, Rik <luiheidsgoeroe@hotmail.com>
>wrote:
>
>>> I am having a script problem.
>>>
>>> When I turn on all reporting, the only thing I get is a few
>>> insignificant 'notices', but nothing else.n I should mention now that
>>> the script was working just fine at one point, and I am not sure what
>>> happened to make it stop. The Notices in php error reporting existed
>>> then as well, so I know it has nothing to do with them.
>>>
>>> Other than that, my script just stops. I can't find an error in it!
>>
>>Stopping could be script error instead of a PHP one... I've had codes
>>die/end prematurely due to an error in setup. PHP won't complain :).
>>
>>> Anyone have suggestions as to how I can proceed to dig out the real
>>> issue?
>>
>>use this code:
>><?php
>>echo 'Untill here it works:'.__FILE__.':'__LINE__."\n";
>>flush();
>>?>
>>
>>Place it at major points in your code (if you get any output obviously
>>start just after the last verifiable point), follow the flow and see where
>>it dies, and then zone in on the fatal error placing these closer and
>>closer together. Or if you;re afraid of polluting your code to much just
>>follow the flow placing it further and further untill it doesn't show
>>anymore, and check the piece just before that.
>>
>>If that all sounds to much work and you have control over
>>extentions:http://xdebug.org/, and you can see what the last function was
>>before the end.
>
>
>I did something similar and I was able to track down where the bug
>was. I am confused by the bug, though:
>
>It seems the script stopped at a point where I made a call from a
>mysql table like this:
>
>$foo = mysql_fetch_array(mysql_query(SELECT * FROM table a WHERE id =
>12));
>
>Which always worked before. The difference now, though, is that table
>a is now empty. And the script stopped because of that. Without
>showing an error - even on the mysql side of things.
>
>Is there some special circumstance as to why a script would stop
>because an empty set was returned?
>
>Thanks,
>
>TC
>
>

Maybe the mysql_error() function may offer some useful feedback?

http://us3.php.net/manual/en/function.mysql-error.php

Outside of that, maybe test the $foo array after that to see if your script has
a condition for an empty array?


Tom
--

Download newsgroup MP3's to your Cell or PDA
Free Trial - http://newsguy.com/cellphone.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация