|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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: URL Thanks~Chief |
|
#2
|
||||
|
||||
|
Take a look at the following link and see if there is some code you can use:
http://www.hotscripts.com/PHP/Scrip...Search_Engines/ |
|
#3
|
|||
|
|||
|
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 ![]() |
|
#4
|
||||
|
||||
|
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%'); |
|
#5
|
|||
|
|||
|
THANK YOU
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 |
|
#6
|
|||
|
|||
|
yeah it works
it does work with Postgres as well
![]() thanks dcaillouet URL |
![]() |
| Viewing: Dev Shed Forums > Databases > PostgreSQL Help > a question! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|