You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
683 B
38 lines
683 B
<?php // define our generic db calls for use with mysql
|
|
|
|
function connect($host, $dbname) {
|
|
global $user, $passwd;
|
|
$link = mysql_connect($host,$user,$passwd);
|
|
if(mysql_select_db($dbname,$link)) {
|
|
return($link);
|
|
}
|
|
}
|
|
|
|
function query($link, $query) {
|
|
$result = mysql_query($query, $link);
|
|
return($result);
|
|
}
|
|
|
|
function numrows($result) {
|
|
$count = mysql_num_rows($result);
|
|
return($count);
|
|
}
|
|
|
|
function fetch_object($result, $row) {
|
|
$data = mysql_fetch_object($result);
|
|
return($data);
|
|
}
|
|
|
|
function free_result($result) {
|
|
mysql_free_result($result);
|
|
}
|
|
|
|
function close($link) {
|
|
mysql_close($link);
|
|
}
|
|
|
|
function errormessage($link) {
|
|
return(mysql_error());
|
|
}
|
|
|
|
?>
|