PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 23rd, 2001, 11:52 PM
Chief Chief is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: http://www.crudpot.net
Posts: 3 Chief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Chief
Exclamation a question!

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

Reply With Quote
  #2  
Old July 24th, 2001, 06:55 PM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,173 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 24
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/

Reply With Quote
  #3  
Old July 24th, 2001, 11:14 PM
Chief Chief is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: http://www.crudpot.net
Posts: 3 Chief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Chief
Smile Thanks

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

Reply With Quote
  #4  
Old July 25th, 2001, 06:30 AM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,173 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 24
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%');

Reply With Quote
  #5  
Old July 29th, 2001, 07:41 AM
kintaro_oe4 kintaro_oe4 is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Fresno, CA, USA
Posts: 17 kintaro_oe4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to kintaro_oe4 Send a message via Yahoo to kintaro_oe4
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

Reply With Quote
  #6  
Old July 29th, 2001, 12:49 PM
Chief Chief is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: http://www.crudpot.net
Posts: 3 Chief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Chief
yeah it works

it does work with Postgres as well

thanks dcaillouet


URL

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > a question!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT