[Xerte-dev] Re: upgrading and ldap

David Goodwin david at palepurple.co.uk
Wed Sep 5 22:57:37 BST 2012


Hi,
See below :

> 
> So the relevant section of code that isn't working seems to be:
> 
> $fields = array_keys($ldap_details);
>        $qmarks = '';
>        $comma = '';
>        foreach($fields as $field) {
>            $qmarks .= $comma . '?';
>            $comma = ',';
>        }
>        _debug("Running SQL to copy sitedetails stuff into the ldap table -
> " . print_r($ldap_details, true));
>        $ok = db_query_one("INSERT INTO {$ldaptable} ($fields)
> VALUES($qmarks)", array_values($ldap_details));
>        return "Migrated LDAP settings from sitedetails to ldap - ok ? " . (
> $ok ? 'true' : 'false' );
>    }
> }
> 
> Should $qmarks .= $comma . '?'; be $qmarks = $comma . '?'; e.g. without the
> dot before the equals? Not that removing that fixes the main problem.
> What else is wrong?
> 

$foo .= "x"

is the same as :

$foo = $foo . "x"

It should be :

$qmarks .= $comma . "?" 

I'll see if I can get it working on a local install.

David.

Pale Purple Ltd.  (Company No: 5580814)
'Business Web Application Development and Training in PHP'

http://www.palepurple.co.uk   
Office: 0845 0046746     Mobile: 07792380669 

Follow us on Twitter: @PalePurpleLtd








More information about the Xerte-dev mailing list