Re: mysql apache - page never finish loading



On 2006-07-10 10:00:41 +1000, "flamer die.spam@xxxxxxxxxxx" <die.spam@xxxxxxxxxxx> 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.

.



Relevant Pages

  • Re: mysql apache - page never finish loading
    ... why should you always have one on SQL function calls? ... This method is used heavily in my production environment and has yet to fail me. ... Saves having to look through error logs. ...
    (comp.lang.php)
  • Re: What is wrong?
    ... snipped too much of that response; look again;-) The quoted snippet to ... about how to setup to call the procedure to test and debug -- using SQL. ... procedure from RPG when it could be done simply instead, ... Another would be to create an SQL function, either using the SQLP language or SQLRPGLE. ...
    (comp.sys.ibm.as400.misc)
  • Re: Obtaining SQL insert auto generated key from query within JSP
    ... Do a search on that sql function, ... The SQL for retrieving a serial number assigned by the DBMS is very specific to the DBMS. ... I've not used JSP so if JSP magically unifies this, that would be surprising but welcome! ... I couldn't find anything in the JSTL SQL section to allow access to the statement, which is what Derby uses to get generated keys. ...
    (comp.lang.java.programmer)
  • Re: convert Money to Words
    ... All our applications are web based. ... And they are using MS report server to ... > not in SQL, that translates the number into words. ... >> there an SQL function that can do this or am I going to have to write the ...
    (microsoft.public.sqlserver.programming)
  • RE: Backups have Shadow Copy Problems
    ... Active backup destination: File ... Reason: The process cannot access the file because it is being used by ... Warning: Unable to open "C:\Documents and Settings\Administrator\Local ... Warning: Unable to open "C:\Program Files\Microsoft SQL ...
    (microsoft.public.windows.server.sbs)