Forum Moderators: coopster

Message Too Old, No Replies

Help with sorting, and only showing certain stuff

         

TeelaBrown

4:17 pm on Nov 7, 2008 (gmt 0)

10+ Year Member



I need some help. I am very new to the PHP world and hacking my way around. So if my question doesn't make sense, let me know and I will try to re-word.

I have these profile type pages. And I want to split them up so that I have a page for people living in different areas.

I already have it set up to only show profiles that have been approved. So if I want it to only show profiles where the cell titled "area" has "east" in it, how do I do that?

This is what I have:

$newquery = "SELECT ID, name, year, area, photopath, releasedate FROM profiles_table WHERE released=1 ORDER BY releasedate DESC LIMIT $offset, $rowsPerPage ";

Any thoughts? Does my question make any sense?

eelixduppy

4:30 pm on Nov 7, 2008 (gmt 0)



Hello and Welcome to WebmasterWorld! :)

You can use a full-text search: [dev.mysql.com...]

Maybe something like this:


$newquery = "SELECT ID, name, year, area, photopath, releasedate FROM profiles_table WHERE released=1 AND MATCH (area) AGAINST ('east') ORDER BY releasedate DESC LIMIT $offset, $rowsPerPage ";

See if that works.

wheelie34

4:33 pm on Nov 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi TeelaBrown and welcome to the forums

Try adding an AND within your WHERE clause

WHERE released=1 AND area=east DESC ......

HTH

TeelaBrown

4:39 pm on Nov 7, 2008 (gmt 0)

10+ Year Member



ARG getting a DB error when I add either one.

Ok my area is actually East One (so there is a space) could that be the cause of the error?

Everything works fine before I try to only show the area.

(thanks for the welcome...loooooong time lurker!)

eelixduppy

4:46 pm on Nov 7, 2008 (gmt 0)



>> ARG getting a DB error

What is it?

TeelaBrown

4:53 pm on Nov 7, 2008 (gmt 0)

10+ Year Member



DOH

unexpected T_WHILE on line 114

which is...
while($row = mysql_fetch_array($result))
{

mbarizia

10:44 pm on Nov 7, 2008 (gmt 0)

10+ Year Member



Sorry but i wanna know the lines before while keyword, i guess that you forgot 2 put ';' the semicolon before.