16 |
/****************************************************************/ |
/****************************************************************/ |
17 |
|
|
18 |
/* establish a connection to the database or bailout */ |
/* establish a connection to the database or bailout */ |
19 |
$con = mysql_connect ( $db_srv, $db_usr, $db_pwd ) |
$con = xx_connect ( $db_srv, $db_usr, $db_pwd ) |
20 |
or die ( "ERROR: Could not connect to database server!" ); |
or die ( "ERROR: Could not connect to database server!" ); |
21 |
$result = mysql_select_db ( $db_nam, $con ) |
$result = xx_select_db ( $db_nam, $con ) |
22 |
or die ( "ERROR: Could not connect to database!" ); |
or die ( "ERROR: Could not connect to database!" ); |
23 |
|
|
24 |
/****************************************************************/ |
/****************************************************************/ |
29 |
/* return an error message from a failed sql query */ |
/* return an error message from a failed sql query */ |
30 |
function sql_err ( $p_sql ) { |
function sql_err ( $p_sql ) { |
31 |
printf ( "ERROR: Query failed.<br>%s<br>%s: %s<br>\n", |
printf ( "ERROR: Query failed.<br>%s<br>%s: %s<br>\n", |
32 |
$p_sql, mysql_errno(), mysql_error() ); |
$p_sql, xx_errno(), xx_error() ); |
33 |
return 1; |
return 1; |
34 |
} |
} |
35 |
|
|