Re: forms /selects

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




I see a couple of errors, one of which is the source of your problem.
You write:
        "SELECT name FROM thetable WHERE (nome=$leter%) ORDER BY nome ASC";
This would evaluate to
        "SELECT name FROM thetable WHERE (nome=A%) ORDER BY nome ASC";

What you need to write is:
        "SELECT name FROM thetable WHERE (nome like '$leter%') ORDER BY nome ASC";

"like" is required to make regular _expression_ match.
The quotes are always required when dealing with strings (and a few other types).

You could have just debugged this by
        echo $query;

Also: Letter contains two t's. :)

Regards
/Jørn Cornelius Olsen

[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux