Reply to Re: PHP/MySQL warnings about results

Your name:

Reply:


Posted by Jerry Stuckle on 11/24/07 12:49

Knut Krueger wrote:
> Jerry Stuckle schrieb:
>> Knut Krueger wrote:
>>> Michael Fesser schrieb:
>>>> .oO(Knut Krueger)
>>>>
>>>>> withour talking abut the SQL problem - see the other guys it should
>>>>> be possible to prvent the error message with
>>>>>
>>>>>
>>>>> $data = @mysql_fetch_array($result,MYSQL_ASSOC))
>>>>>
>>>>> I do not know whether it is working with
>>>>> mysql_fetch_array($result,MYSQL_ASSOC))
>>>>> but it is working with @mysql_query and @mysql_num_rows
>>>>
>>>> Using '@' is really bad style in most cases. It suppresses the error
>>>> message instead of fixing it.
>>>>
>>>> Micha
>>> but it is better to supress one error instead of setting
>>> error_reporting off, isn`t it?
>>> Regards Knut
>>>
>>
>> It's better to not cause the error in the first place.
>
> Just one question to the sql problem.
> where is technical the difference (count of SQL branches cpu cycles
> etc.) to look for an entry suppress the error if, it is not there and
> branch to the "error routine" instead using an other PHP-SQL call to
> look for the record without error, and branch to the same "error
> routine"? Both ways seems to be equal in the result.
>
> Regards Knut
>
>>
>

CPU cycles have nothing to do with it. This is all about good
programming techniques.

It is much better to not make the call you know is going to cause an
error in the first place. The way you're doing it is just sloppy
programming. Such techniques are problems just waiting to happen.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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