Welcome to WebmasterWorld Guest from 54.162.226.212

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Form output using mysql, search people name in specific category

     
3:07 pm on Mar 23, 2008 (gmt 0)

5+ Year Member



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 : people_name , example : John, Michael, etc
category name field in mysql : people_category , 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

<select name="metode" size="1">
<option value="people_name">Search All People</option>
<option value="people_name_just_from_adult_category">Search People By Category</option>
</select>
<input type="text" name="search" size="25">
<input type="submit" value="Search" name="Go" />

Please share your php mysql knowledge here

4:52 pm on Mar 23, 2008 (gmt 0)

5+ Year Member



What is linking the two tables? for example how does the people table know what category they are in?

Maybe there could be a link to the category table from the name table

PEOPLE NAME
ID, name, catID

PEOPLE CATEGORY
catID, category

The catID in the people_name table will then hold what category the person is in, you can then easily search what category people are in

"SELECT * FROM people_name WHERE catID = '2'"

Hipe i have understood correctly
Ally

 

Featured Threads

Hot Threads This Week

Hot Threads This Month