OSDN Git Service

fix: fetch_array() in DBRecord.class.php
authorSushi-k <epgrec@park.mda.or.jp>
Thu, 16 Jul 2009 02:52:00 +0000 (11:52 +0900)
committerSushi-k <epgrec@park.mda.or.jp>
Thu, 16 Jul 2009 02:52:00 +0000 (11:52 +0900)
DBRecord.class.php

index b1f1b03..ba46c0e 100755 (executable)
@@ -58,17 +58,17 @@ class DBRecord {
                
                $sqlstr = "SELECT * FROM ".$this->table.
                            " WHERE ".mysql_real_escape_string( $property ).
-                             " like '".mysql_real_escape_string( $value )."%'";
+                             "='".mysql_real_escape_string( $value )."'";
                
                if( $options != null ) {
-                       $sqlstr .= " ".mysql_real_escape_string( $options );
+                       $sqlstr .= "AND ".$options;
                }
                $res = $this->__query( $sqlstr );
                while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
                        array_push( $retval, $row );
                }
                
-               return $res;
+               return $retval;
        }
        
        function __set( $property, $value ) {