SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old June 23rd, 2003, 01:15 AM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
query db for words like search

I want a search engine, I read a few articles on it, the one for making one for all words on my site, but that one isn't very relavent cause most of the info is from the db's, and the other is for words already entered into a db...
is there some way to simply search through a db for words like the $search?

this wasn't returning an error, but was still not returning anything...

PHP Code:
 $result mysql_query = ("SELECT * FROM users WHERE username LIKE "
 
$_POST['search'] . "");
while(
$result2 mysql_fetch_row($result[1]))
{ echo 
"$result2"; } 

I thought that luike would be the logical word to try ina query like this... I do not really understand the dumb manual all the time, all I could find in it was hard to try to understand or apply to this... anyway, jsut wondering if there was an easy way to go about this.
thanks.
__________________
hey it's the CHARKING

Reply With Quote
  #2  
Old June 23rd, 2003, 08:44 AM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 364 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 26 sec
Reputation Power: 6
PHP Code:
 $search $_POST['search'];
$result mysql_query = ( "SELECT * FROM users WHERE username LIKE '$search%'" ); 
__________________
-- Jason

Reply With Quote
  #3  
Old June 23rd, 2003, 09:20 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Placing the wildcard symbol (%) either side of the keyword will look for any occurence of the search term in a block of text, whether it's at the start, middle or end, or anywhere in between.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #4  
Old June 25th, 2003, 03:20 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
thanks so much

hey thanks guys so much this really helped me, i am making a really great search tool now, thanks to youse guys!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > query db for words like search


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 | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway