11 var $database_hostname="";
12 var $database_user="";
13 var $database_password="";
15 var $database_connection=0;
17 Function Connect($database_name)
19 global $bugs_database_host;
21 if($this->database_connection
!=0)
23 $bugs_debug("The connection to the bugs database is already established!\n");
26 if(($this->database_connection
=mysql_pconnect($this->database_hostname
,$this->$database_user,$this->$database_password))<=0)
28 $bugs_debug("It was not possible to connect to the bugs database! (".mysql_error().")\n");
31 mysql_select_db($database_name,$this->database_connection
);
32 return($this->database_connection
);
35 Function Query($query)
37 if($this->database_connection
<=0)
38 $bugs_debug("The connection to the bugs database is not yet established!\n");
39 return(mysql_query($query,$this->database_connection
));
44 return(mysql_error());
47 Function CreateDatabase($name)
49 if($this->database_connection
==0)
51 if(($link=mysql_Connect($this->database_hostname
,$this->database_user
,$this->database_password
))==0)
55 $link=$this->database_connection
;
56 $success=mysql_create_db($name,$link);
57 if($this->database_connection
==0)
64 if($this->database_connection
!=0)
66 mysql_Close($this->database_connection
);
67 $this->database_connection
=0;
71 Function SeparateDateTime()
81 Function ScanDate($date)
83 $scanned_date["year"]=strtok($date,"-");
84 $scanned_date["month"]=strtok("-");
85 $scanned_date["day"]=strtok(" ");
86 return($scanned_date);
89 Function TextFieldsNeedLength()
94 Function SupportAutoIncrement()
99 Function SupportSequences()
104 Function FetchInsertId()
106 return(mysql_insert_id());
109 Function NumberOfRows($result)
111 return(mysql_num_rows($result));
114 Function FreeResult($result)
116 return(mysql_free_result($result));
119 Function FetchNextRow($result)
121 return(mysql_fetch_row($result));
124 Function NumberOfFields($result)
126 return(mysql_num_fields($result));
129 Function FetchNextField($result)
131 return(mysql_fetch_field($result));
134 Function FetchArray($result)
136 return(mysql_fetch_array($result));
139 Function FetchResult($result,$row,$field)
141 return(mysql_result($result,$row,$field));