TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-23-2009, 10:37 AM   #1 (permalink)
The Wanderer
 
rupam_jaiswal's Avatar
 
Join Date: Jun 2008
Posts: 8
Thanks: 0
rupam_jaiswal is on a distinguished road
Default match a value

Hi,
My table is like this

Id,Name,Location,Hobby

Condition is
- if location is 1 then possible values of Hobby can be a1,a2,a3,a4,a5
- if location is 2 then possible values of Hobby can be b1,b2,b3,b4,b5
- if location is 3 then possible values of Hobby can be c1,c2,c3,c4,c5
- if location is 4 then possible values of Hobby can be d1,d2,d3,d4,d5

Now I have to get the row whose hobby value is suppose a1.
How can I do this.I can't use like operator a1% as a100 will match then
Regards
rupam_jaiswal is offline  
Reply With Quote
Old 07-23-2009, 12:48 PM   #2 (permalink)
The Acquainted
 
JaoudeStudios's Avatar
 
Join Date: Jul 2009
Location: Surrey
Posts: 105
Thanks: 1
JaoudeStudios is on a distinguished road
Default

What is your query so far? and can you post your schema?
__________________
JaoudeStudios.com | JaoudeStudios.com Forum | JaoudeStudios.com Blog
OpenSource is the road ahead...!
JaoudeStudios is offline  
Reply With Quote
Old 07-27-2009, 04:17 AM   #3 (permalink)
The Contributor
 
dschreck's Avatar
 
Join Date: Nov 2007
Location: California
Posts: 82
Thanks: 0
dschreck is on a distinguished road
Default

could always do an EAV data scheme
__________________
Where I Ramble: http://www.iwilldomybest.com/
What I do: Zynga Game Network
Senior Software Engineer at CityVille
dschreck is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Match $var in text file ? Peuplarchie General 1 07-01-2009 06:14 PM
Array Match String buildakicker General 2 10-29-2008 05:34 PM
Google-News-Like Headline Grouping Algorithm serversphere Advanced PHP Programming 0 02-29-2008 05:21 PM
URL to Match Haris Absolute Beginners 6 11-13-2007 09:56 AM
Regular Expressions Haris General 6 09-29-2007 03:18 PM


All times are GMT. The time now is 04:07 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design