|  | 
  Nicolas Machado - 2009-01-09 14:56:30Hi, I added ( created a new Adapter ) for supporting postgresql, I'n na totally newby php coder, so I only want to know if there is another workaround to the one I meet.
 
 I think that the problema was in SelectOneValue return, so I create an specific selectCount function.
 
 I will try to send the file.
 
 Best Regards
  Nicolas Machado - 2009-01-09 15:05:44 - In reply to message 1 from Nicolas MachadoI also change some lines in the main class because LIMIT clause is not allowed like mysql.
 its the opsite, an you must use LIMIT OFSET
 so I:
 /**
 * Sets the limit by clause
 *
 * @param integer $low The minimum row number
 * @param integer $high The maximum row number
 */
 //private function setLimit($low, $high)
 private function setLimit($high, $low)
 {
 $this->limit = array('Low' => $low,
 'High' => $high);
 }
 
 
 and the sql clause:
 // LIMIT
 if ($this->limit)
 //ver funcion SetLimit, en postgres SQL se usa el Offset
 //$limit = "LIMIT " . $this->limit['Low'] . ", " . $this->limit['High'];
 $limit = "LIMIT " . $this->limit['Low'] . " OFFSET " . $this->limit['High'];
 //$limit = "LIMIT " . $this->limit['High'];
 else
 $limit = '';
 
 
 Best Regards
  Alain Cheng - 2009-01-21 13:47:23 - In reply to message 2 from Nicolas MachadoCan you send me your code of connection to postgresql?
 I can connect to my postgresql
 but i always have 0 results.
 
 I don't understand why
 DO i have to change anything in printTable()?
 
 
  ptx - 2009-07-16 01:10:42 - In reply to message 3 from Alain Chengi "rewrite" a few line in this method (and replace the mysql function for valid function in pgsql
 public function selectOneValue($field, $table, $where = false, $orderby = false){
 
 $result = $this->selectOne($field, $table, $where, $orderby);
 $carac= array('(',')','*');
 $field = str_replace($carac,"",$field );
 
 return $result[$field];
 
 }
  ionutz ionutz - 2009-08-18 07:08:43 - In reply to message 1 from Nicolas Machado
  Karol - 2011-08-25 11:36:53 - In reply to message 4 from ptxThis code is Ok, but You must change line: $field = str_replace($carac,"",$field );
 
 public function selectOneValue($field, $table, $where = false, $orderby = false){
 
 $result = $this->selectOne($field, $table, $where, $orderby);
 $carac= array('(',')','*');
 $field = strtolower(str_replace($carac,"",$field ));
 
 return $result[$field];
 
 }
 |