/[cvs]/bareface/yakka/storage-providers/YakkaMySqlDatabase.php
ViewVC logotype

Annotation of /bareface/yakka/storage-providers/YakkaMySqlDatabase.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sun Jan 5 00:22:26 2003 UTC (21 years, 10 months ago) by bareface
Branch: MAIN
CVS Tags: HEAD
init;

1 bareface 1.1 <?php
2    
3     class YakkaMySqlDatabase {
4     var $connection;
5    
6     function YakkaMySqlDatabase() {
7     }
8    
9     function connect($host, $database, $user, $password) {
10     if ($this->connection = @mysql_connect($host, $user, $password, true))
11     mysql_select_db($database, $this->connection);
12     }
13    
14     function execute($sql) {
15     return mysql_query($sql, $this->connection);
16     }
17    
18     function escapeString($string) {
19     return mysql_escape_string($string);
20     }
21    
22     function queryRecord($sql) {
23     $row = null;
24     if ($result = $this->execute($sql)) {
25     $row = mysql_fetch_assoc($result);
26     mysql_free_result($result);
27     }
28     return $row;
29     }
30    
31     function queryRecordset($sql) {
32     $recordset = array();
33     if ($result = $this->execute($sql)) {
34     while($row = mysql_fetch_assoc($result))
35     $recordset[] = $row;
36    
37     mysql_free_result($result);
38     }
39     return $recordset;
40     }
41     }
42    
43     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed