comparison msite.inc.php @ 66:230aacc22cb4

Move some functions to site lib.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 05 Oct 2013 17:59:24 +0300
parents 72b22729ae7e
children 30a4420e85ab
comparison
equal deleted inserted replaced
65:72b22729ae7e 66:230aacc22cb4
502 stLogSQLError($sql); 502 stLogSQLError($sql);
503 return FALSE; 503 return FALSE;
504 } 504 }
505 } 505 }
506 } 506 }
507
508
509 function stSetStatus($val, $msg)
510 {
511 global $statusSet;
512 if (!$statusSet)
513 {
514 header("Status: ".$val." ".$msg);
515 }
516 $statusSet = TRUE;
517 }
518
519
520 function stExecSQLCond($sql, $okmsg)
521 {
522 if (($res = stExecSQL($sql)) !== FALSE)
523 {
524 if ($okmsg != "")
525 stSetStatus(200, $okmsg);
526 return $res;
527 }
528 else
529 {
530 stSetStatus(900, "Error in SQL execution.");
531 return FALSE;
532 }
533 }
534
535
507 ?> 536 ?>