Current location: Hot Scripts Forums » Programming Languages » PHP » basic SQL


basic SQL

Reply
  #1 (permalink)  
Old 06-23-04, 10:16 PM
eq1987 eq1987 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
basic SQL

I am using
Code:
$SQL = "SELECT * FROM users WHERE id LIKE '$user_input' OR guildname LIKE '%$user_input'%";

but it wont search the guildname, only the ID, so if i type 4, the guild with 4 as an id will come up, but if i type The Awesome Guild, it wont come up... can someone please show me whats wrong? Thanks, by the way, it wont work without the % either.
Reply With Quote
  #2 (permalink)  
Old 06-24-04, 12:18 AM
sufyan sufyan is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Melbourne, AU
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Try this:
Code:
$SQL = "SELECT * FROM users WHERE id LIKE '$user_input' OR guildname LIKE '%$user_input%'";
I changed '%$user_input'% to '%$user_input%'
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL infinite loop problem with VB application Syed Visual Basic 2 05-07-04 10:19 AM
Help with ASP & FORMS blessedrub ASP 0 01-23-04 10:22 AM
union sql msrnivas ASP.NET 1 10-21-03 03:36 PM
ASP Calendar..HELP...pls jimthepict ASP 1 07-31-03 05:01 PM
change my field in this example sal21 ASP 3 07-14-03 02:49 AM


All times are GMT -5. The time now is 05:06 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.