July 24th, 2001, 12:52 AM
I'm sad to see how much less popular this forum is compared to the MySQL one. Oh well. Anyway I just have a question about doing searches in the database. I'm sure it's really simple, but postgresql.org's documentation is really horrible (in my opinion). Anyway I just want to know how to make a simple search with php/sql. Just so people can enter a word or string and sql will select rows containing that text in a specified field.
Check out my PHP/PostgreSQL driven website at: http://www.crudpot.net Thanks
July 24th, 2001, 07:55 PM
July 25th, 2001, 12:14 AM
I actually figured out how to do it, but thanks for that link.
If anyone cares its just:
select * from TABLE where COLUMN like '%searchword';
The problem now is how to get it so it isn't case sensitive
July 25th, 2001, 07:30 AM
Why don't you try casting the field and search phrase to the same case? I don't have Postgresql loaded on this machine so I can't test this:
select * from TABLE where upper(COLUMN) like upper('%searchword%');
July 29th, 2001, 08:41 AM
I have been trying to figure this out!
I have a news script for my site that I wrote, and I have a searchable news achive, but it was case sensitive.
I had not the knoledge nor the experiance to figure this out myself.
I even posted a message here on devshed called "Case sensitive is bad..." but to no avail
then i searched for the words "case sensitive" and after looking at a few worthless posts, i found this
im not sure wether it works with Postgresql or not, but it sure works with MySql
July 29th, 2001, 01:49 PM