source: subversion/sites/other/tilesAtHome/connect/connect_sample.php @ 3655

Last change on this file since 3655 was 2272, checked in by ojw, 13 years ago

tiles at home website

File size: 352 bytes
Line 
1<?php
2
3  $DbSuccess = ConnectDB();
4 
5  // Set $NoExitOnDbFail to handle database errors yourself, default is to exit the script
6  if(!$DbSuccess && !$NoExitOnDbFail)
7    exit;
8   
9
10  function ConnectDB(){
11    if(!@mysql_connect("server","user","pass"))
12      return(0);
13
14    if(!mysql_select_db("db"))
15      return(0);
16     
17    return(1);
18    }
19?>
Note: See TracBrowser for help on using the repository browser.