On Wed, Feb 26, 2003 at 10:25:56AM +0100, Tarjei Huse wrote:
> What about get_person_by_name($name) ?

Even if $name == '1000', code in midgard-php treats it as number. And use
it as ID. At least, I saw it in code some time ago, but I'm not sure that
it is fixed.

> ons, 2003-02-26 kl. 10:12 skrev pp:
> > Sergei Dolmatov <[EMAIL PROTECTED]> wrote:
> > 
> > > >   $user = mgd_get_person( "1000");
> > > > 
> > > > it returns NULL because it is trying to find the user number 1000 in the 
> > > > database, rather than the user NAMED 1000.
> > > > 
> > > > How can I get around this problem?
> > > 
> > > Unfortunately, current mgd_get_person() implementation contains both id
> > > and name check. So when argument to this function contains only digits, it
> > > assumes that it is id (doesn't rely on type of argument).
> > > 
> > > So I don't know how you could work around this problem without rewriting
> > > this function in midgard-php or fixing your person names - just add any
> > > letter in name.
> > 
> > I am not sure if that could help cause PHP itself will treat '1000a' as '1000'.
> > (Maybe settype?) 
> > The only solution is get person by its ID.
> > Why that can not be used? 

It doesn't depend on Zend, it's midgard-php behavior.

--
Regards,
Sergei Dolmatov.
---
USENET would be a better laboratory is there were more labor and less oratory.
                -- Elizabeth Haley

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to