You are here: Re: mysql apache - page never finish loading « PHP Programming Language « IT news, forums, messages
Re: mysql apache - page never finish loading

Posted by Mel on 07/11/06 14:57

On 2006-07-10 10:00:41 +1000, "flamer die.spam@hotmail.com"
<die.spam@hotmail.com> said:

> i would stick in an ' or die (mysql_error ()); ' at the end of the
> statement, probably is coming across an error but for some reason keeps
> trying.. you really should have that on all your sql queries.
>
> Flamer.


I'm curious: why should you always have one on SQL function calls? I
never use them and opt for things like:

$link = @mssql_connect(CONNECTION_STUFF_HERE);
if ($link === false) {
// handle error
}
if (@mssql_select_db(DBNAME,$link) === false) {
// handle error
}
$sql = "select * from myTable";
$res = @mssql_query($res);
if ($res === false) {
// handle error
}

Normally this'd be in a class and '// handle error' would throw an
Exception. This method is used heavily in my production environment and
has yet to fail me. I'm not poo-pooing the idea of the die() or exit()
functions inline with the SQL functions, just wondering why they should
be used.

 

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

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