changeset 17:d3ee3927eb3a

fix: fetch_array() in DBRecord.class.php
author Sushi-k <epgrec@park.mda.or.jp>
date Thu, 16 Jul 2009 11:52:00 +0900
parents cf19005e65d1
children 19cd7816b2c1
files DBRecord.class.php
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/DBRecord.class.php	Wed Jul 15 13:02:20 2009 +0900
+++ b/DBRecord.class.php	Thu Jul 16 11:52:00 2009 +0900
@@ -58,17 +58,17 @@
 		
 		$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 ) {