Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 455 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

My second php script (using mysql, elseif and searching)

Thread title: My second php script (using mysql, elseif and searching)
Closed Thread    
    Thread tools Search this thread Display Modes  
02-11-2005, 05:13 PM
#1
DateinaDash is offline DateinaDash
Status: The BidMaster
Join date: Nov 2004
Location: England
Expertise:
Software:
 
Posts: 10,821
iTrader: 0 / 0%
 

DateinaDash is on a distinguished road

  Old  My second php script (using mysql, elseif and searching)

Hey everyone, just finished this http://www.talkfreelance.com/newproperty.html and http://www.talkfreelance.com/search.html. Tell me what you think!

I'm working on setting up a "sort" function so it can sort the properties in order of bedrooms, price etc. It's driving me nuts though! Anyone have any idea how i can implement this?

I'm basically doing the search like this....


mysql_select_db('talkfreelance_com_-_3');
$query = "select * from property where ".$searchtype." like '%".$searchterm."%'";

02-11-2005, 08:14 PM
#2
Keith is offline Keith
Keith's Avatar
Status: Junior Member
Join date: Feb 2005
Location: Dublin, Ireland
Expertise:
Software:
 
Posts: 50
iTrader: 0 / 0%
 

Keith is on a distinguished road

  Old

Post the source code so we can see how you coded the pages. The sorting thing is easy enough. Change the results.page to use GET instead of POST. Add an optional query to the URL called something like sortby=xxxxx.

Then get the value of sortby using $_GET['sortby'];

Then use a switch statement to alter the msql query.

I won't post the exact code. Instead I'll let you work it out for yourself

02-12-2005, 06:24 AM
#3
Travis is offline Travis
Status: Member
Join date: Jul 2004
Location:
Expertise:
Software:
 
Posts: 445
iTrader: 0 / 0%
 

Travis is on a distinguished road

  Old

Good to see you got it working Your learning php is going quite well.

02-12-2005, 08:31 AM
#4
Peter Avey is offline Peter Avey
Peter Avey's Avatar
Status: On Vacation
Join date: Feb 2005
Location: on my mac
Expertise:
Software:
 
Posts: 1,138
iTrader: 1 / 100%
 

Peter Avey is an unknown quantity at this point

Send a message via MSN to Peter Avey

  Old

yes i agree.. now all you need to do is add your scripts to sites/templates

02-12-2005, 10:33 AM
#5
FiveInteractive is offline FiveInteractive
Status: Request a custom title
Join date: Jan 2005
Location: UK
Expertise:
Software:
 
Posts: 1,216
iTrader: 0 / 0%
 

FiveInteractive is on a distinguished road

Send a message via AIM to FiveInteractive Send a message via MSN to FiveInteractive

  Old

Looks like its going pretty well, keep at it

02-12-2005, 03:15 PM
#6
Michael is offline Michael
Michael's Avatar
Status: Senior Member
Join date: Dec 2004
Location:
Expertise:
Software:
 
Posts: 845
iTrader: 0 / 0%
 

Michael is on a distinguished road

  Old

looking nice !

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed