Hello everyone,
New to daniweb; this is an excellent forum and I've learned a lot in the short time I've been here.

Trying to build a traditional dating site, and as such, it's crucial the members can search for other members on the site.
I am also new to PHP, know very little about it and need help with the following-

I am trying to figure out how to do the following two things:

1a.) How do I display online members?
b.) How do I sort the online members by location?

2) When members search for other members, I would like to have a search feature where
they can specify the search criteria by age, sex and location. Not sure how to do this either.

Any help on this would be greatly appreciated; and if you could show me or point me to an example of the exact coding I would need to enter that would be even better (like I said, I'm a total newb to PHP, but I want to learn it and understand it because it seems to be very useful)...

Thanks in advance!

1a.) How do I display online members?

Have a column(online) in your table and set it to 1 whenever the user logs in. Then list only those users who are online.

$q="select * from table where online=1";

b.) How do I sort the online members by location?

$q = "select * from table where online=1 order by location [asc|desc]"; //By default, the sorting is done in ascending order.

2) When members search for other members, I would like to have a search feature where
they can specify the search criteria by age, sex and location.

Simple again.

$q = "select * from table where age='user_input_age' and sex='user_input_sex' and location='user_input_location'";

Btw, you can check out w3schools.com . It has some nice tutorials.

Cheers,
Naveen

Have a column(online) in your table and set it to 1 whenever the user logs in. Then list only those users who are online.

$q="select * from table where online=1";
$q = "select * from table where online=1 order by location [asc|desc]"; //By default, the sorting is done in ascending order.

Simple again.

$q = "select * from table where age='user_input_age' and sex='user_input_sex' and location='user_input_location'";

Btw, you can check out w3schools.com . It has some nice tutorials.

Cheers,
Naveen

Excellent, thank you very much!

This article has been dead for over six months. Start a new discussion instead.