[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PHP4, mysql and horde: Why IMP from woody won't work with PHP4



This would explain why it works on the system I tested php4 support with...
since it's a pgsql system and not a mysql...

hmmm...

I will dump this off to the imp list and see if we can get something done
about this since I'm not a php hacker...

Ivan

On Tue, Jul 18, 2000 at 05:58:00PM +0200, Alexander List wrote:
> On Tue, 18 Jul 2000, Ivan E. Moore II wrote:
> 
> Ok, I think I finally found it:
> 
> phplib, file ct_sql.inc, class CT_Sql, function ac_store, in the horde
> version of phplib exactly on line 90ff:
> 
> ---snip1 ct_sql.inc---
>     $this->db->query($uquery);
>     if (  $this->db->affected_rows() == 0
>       && !$this->db->query($iquery)) {
>         $ret = false;
>     }
> ---snip1---
> 
> That's to check if there's already a session open. If yes, it does an
> update, if no, it does an insert.
> 
> affected_rows stems from db_mysql.inc and looks like this
> 
> ---snip2 db_mysql.inc---
>   /* public: evaluate the result (size, width) */
>   function affected_rows() {
>     return @mysql_affected_rows($this->Link_ID);
>   }
> ---snip2---
> 
> searching this function in
> 
> /usr/lib/php4/DB/mysql.php, we find:
> (in the source tarball this is in php4-4.0.1pl2/pear/DB/mysql.php)
> ---snip3 mysql.php---
> 
>         // TODO/wishlist:
>         // simpleFetch
>         // simpleGet
>         // affectedRows
> 
> ---snip3---
> 
> 
> which leads me to the conclusion that mysql_affected_rows seems not to be
> implemented in php4 version 4.0.1pl2-2, therefore obviously returns 0 and
> causes ac_store to do an insert instead of an update.
> 
> But I may be wrong...
> 
> So much for the problem, I am not a programmer so I cannot provide a quick
> solution...
> 
> 
> regards
> 
> Alex
> 
> 
> 
---end quoted text---

-- 
----------------
Ivan E. Moore II
rkrusty@tdyc.com
http://snowcrash.tdyc.com
GPG KeyID=90BCE0DD
GPG Fingerprint=F2FC 69FD 0DA0 4FB8 225E 27B6 7645 8141 90BC E0DD



Reply to: