forgotten commit. disabled until egl is adapted.
[AROS-Contrib.git] / bgui / bugs / bugs_mysql.php
blobddc85884ed0be73218b22a8554fb86ae8f167050
1 <?
2 /*
3 * bugs_mysql.php
5 * @(#) $Header$
7 */
9 class bugs_mysql_class
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");
24 return(0);
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");
29 return(0);
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));
42 Function Error()
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)
52 return(0);
54 else
55 $link=$this->database_connection;
56 $success=mysql_create_db($name,$link);
57 if($this->database_connection==0)
58 mysql_Close($link);
59 return($success);
62 Function Close()
64 if($this->database_connection!=0)
66 mysql_Close($this->database_connection);
67 $this->database_connection=0;
71 Function SeparateDateTime()
73 return(0);
76 Function DateFormat()
78 return("Y-m-d");
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()
91 return(0);
94 Function SupportAutoIncrement()
96 return(1);
99 Function SupportSequences()
101 return(0);
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));