charset="iso-8859-15"

Content-Transfer-Encoding: quoted-printable

Content-Disposition: inline


Am Montag, 6. September 2004 23:50 schrieb Pete Holsberg:

[...]

> $sql =3D "SELECT * FROM $table ";

> $sql .=3D "WHERE `LastName` LIKE $search_string ";

> $sql .=3D "OR `FirstName` LIKE $search_string ";

> $sql .=3D "OR `Spouse` LIKE $search_string ";

> $sql .=3D "OR `Street` LIKE $search_string ";

> $sql .=3D "OR `Email` LIKE $search_string LIMIT 0, 30 ";

> $sql .=3D "ORDER BY Street, HouseNum, LastName";

How about =20

$search_string .=3D $search_string . "%";

$sql =3D "SELECT * FROM $table ";

 $sql .=3D " WHERE LastName LIKE '$search_string' ";

$sql .=3D " OR FirstName LIKE '$search_string' ";

$sql .=3D " OR Spouse LIKE '$search_string' ";

$sql .=3D " OR Street LIKE '$search_string' ";

$sql .=3D " OR Email LIKE '$search_string' LIMIT 0, 30 ";

$sql .=3D " ORDER BY Street, HouseNum, LastName";

>   $result =3D mysql_query($sql)

>        or die ("Couldn't execute query.");

>  ...

>

> -------------

>

> Why is that?

>

> Also, how do I make LIKE insensitive to case?

As far as I know LIKE is case insensitve.

> And finally, how do I use the % wildcard with a variable?

See above.



You're welcome



=2D-=20

Wolfgang Ebneter

MSc. Data Engineering

=46ingerprint : 9C66 28A8 7AD8 BA59 6CBB  055C D664 D8FA 8CBA 800C

Key-Server : wwwkeys.eu.pgp.net

Attachment: pgpTWvqAHKVAu.pgp
Description: signature

Reply via email to