/    Sign up×
Community /Pin to ProfileBookmark

Form output using mysql, search people name in specific category

I have search php forms that connecting to mysql, for search people name in all category and search people name in specific category

People name field in mysql : [B]people_name[/B] , example : John, Michael, etc
category name field in mysql : [B]people_category[/B] , example : Kid, Adult, etc

I can Search All People name using first option value below, for example i search : John

beside that i want to search : John only in adult category

what is the right code so i can get people name just from adult category

[QUOTE]

<select name=”metode” size=”1″>
<option value=”people_name”>Search All People</option>
<option value=”[COLOR=”Red”]people_name_just_from_adult_category[/COLOR]“>Search People By Category</option>
</select>
<input type=”text” name=”search” size=”25″>

<input type=”submit” value=”Search” name=”Go” />

[/QUOTE]

Please share your php mysql knowledge here

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@malarzMar 23.2008 — Suppose that you want to search person with name and category and you already have both valuesu escaped

[code=php]
$query="SELECT * FROM table WHERE people_name LIKE '%$name%' AND people_category='$category'";
[/code]


Hope this is what you were looking for ?
×

Success!

Help @basketmen spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.9,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...