summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'shared/classes/0sql_row_obj.php')
-rw-r--r--shared/classes/0sql_row_obj.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/shared/classes/0sql_row_obj.php b/shared/classes/0sql_row_obj.php
index 89a7382..239dae3 100644
--- a/shared/classes/0sql_row_obj.php
+++ b/shared/classes/0sql_row_obj.php
@@ -199,7 +199,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
throw new Exception(get_class($this).' object constructed with single argument ('.$arg.') but found no rows with this in the `'.$this->primary_key[0].'` column (PRIMARY_KEY).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
}
@@ -210,7 +210,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
throw new Exception(get_class($this).' object constructed with single numeric argument ('.$arg.') but found no rows with this in the `'.$this->num_key.'` column (UNIQUE numeric).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
} elseif (isset($this->misc_key)) {
@@ -219,7 +219,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
throw new Exception(get_class($this).' object constructed with single value ('.$arg.') but found no rows with this in the `'.$this->misc_key.'` column (UNIQUE non-numeric).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
}
@@ -238,7 +238,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
} else
throw new Exception(get_class($this).' object constructed with '.func_num_args().' values '.$this->sql_id().' but no rows were found (PRIMARY KEY).');
} else {
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
return;
}
}
@@ -315,7 +315,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
function load() {
if ($this->is_in_db()) {
$r=self::sql_query('SELECT * FROM `'.$this->table.'` WHERE '.$this->sql_id());
- $this->from_array($r->fetch(), true);
+ $this->from_array($r->fetch(PDO::FETCH_ASSOC), true);
}
}
// Deletes this row from the database and clears db_values array
@@ -495,7 +495,7 @@ abstract class sql_row_obj { // If the name of this class changes, it must be up
if ($r->rowCount() == 0) {
return null;
} elseif ($r->rowCount() == 1) {
- $obj->from_array($r->fetch());
+ $obj->from_array($r->fetch(PDO::FETCH_ASSOC));
self::$ref_cache[get_class($this)][$name][$this->__get($name)]=&$obj;
return $obj;
} else {
@@ -630,7 +630,7 @@ class sql_col {
$this->default=$string;
break;
case 'COMMENT':
- if (preg_match('/^refers to: ([a-zA-Z0-9_$]+\.[a-zA-Z0-9_$]+)$/', $string, $match)) {
+ if (preg_match('/^refers to(?::| |: )([a-zA-Z0-9_$]+\.[a-zA-Z0-9_$]+)$/', $string, $match)) {
$this->refers_to=$match[1];
} else {
$this->comment=$string;
@@ -750,7 +750,7 @@ class sql_col {
if (isset($this->comment))
$d.=' COMMENT '.sql_row_obj::sql_quote_string($this->comment);
elseif (isset($this->refers_to))
- $d.=' COMMENT '.sql_row_obj::sql_quote_string('refers to: '.$this->refers_to);
+ $d.=' COMMENT '.sql_row_obj::sql_quote_string('refers to '.$this->refers_to);
return $d;
}
// Returns the array necessary to generate this column using the constructor