[Cs-content-commits] SF.net SVN: cs-content:[391] trunk/1.0/db_types/cs_phpDB__mysql.class.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-06-10 17:41:50
|
Revision: 391 http://cs-content.svn.sourceforge.net/cs-content/?rev=391&view=rev Author: crazedsanity Date: 2009-06-10 17:40:57 +0000 (Wed, 10 Jun 2009) Log Message: ----------- Updated MySQL db abstraction layer. /db_types/cs_phpDB__mysql.class.php: * set_row(): -- call mysql_data_seek() to change rows. -- throws an exception if the call returns false * farray(): -- don't change internal row arbitrarily anymore. -- call mysql_fetch_array() without the second arg ($this->row). -- NOTE: passing the second argument caused strange behaviour, since mysql_fetch_array() was assuming that was indicative of what type of data it should return (numeric, associative, or both). Modified Paths: -------------- trunk/1.0/db_types/cs_phpDB__mysql.class.php Modified: trunk/1.0/db_types/cs_phpDB__mysql.class.php =================================================================== --- trunk/1.0/db_types/cs_phpDB__mysql.class.php 2009-06-09 18:39:50 UTC (rev 390) +++ trunk/1.0/db_types/cs_phpDB__mysql.class.php 2009-06-10 17:40:57 UTC (rev 391) @@ -384,6 +384,9 @@ function set_row($row){ if(is_numeric($row)) { $this->row = $row; + if(!mysql_data_seek($this->result, $this->row)) { + throw new exception(__METHOD__ .": failed to seek row (". $this->row .")"); + } } else { throw new exception(__METHOD__ .": invalid data for row (". $row .")"); @@ -430,10 +433,7 @@ $retval = NULL; } else { - if($this->row == 0) { - $this->row = 1; - } - $retval = mysql_fetch_array($this->result,$this->row); + $retval = mysql_fetch_array($this->result); } return($retval); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |