Current location: Hot Scripts Forums » Programming Languages » PHP » Is this possible in php


Is this possible in php

Reply
  #1 (permalink)  
Old 04-28-11, 01:04 PM
yazz_1988 yazz_1988 is offline
Newbie Coder
 
Join Date: Mar 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Is this possible in php

Hi guys!
For my bus finder application, so far i've gotten searching by routenumber to work (big thanks to the community here ), now i would like to extend upon that and add searching by name too. I'm semi-decent at writing queries but coding, not so much.
I have got the query to work but the coding part i am unsure about.

the query is something like this
PHP Code:

$query "SELECT * FROM mydata WHERE stopname LIKE '%$areaname%' AND routerun = 1 GROUP BY routenumber ORDER BY routenumber"
This is something i would like to achieve.
The user enters "London Bridge" in the 2nd text box area and the page will output the routes with clickable links. But i only want to route numbers to be displayed.
Can this be done or is it too good to be true.

http://i.imgur.com/y2twO.png

The working example for the route number search is at this page > bus finder map .

Can you please help me out here if possible.
Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 04-28-11, 10:38 PM
davidw199 davidw199 is offline
Newbie Coder
 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Well, I noticed in your ajax code, function downloadUrl is the one that gets xml data that contains all stopnames for a particular route number. The data is returned from this page
xmlgen.php?routeno=53&routerun=1

Well, in this xmlgen.php file, you can add more php code that will accepts 1 one more parameter. Let's call this parameter "areaname".

So, if areaname exists in form post, then use the query you described above and return the correct data.
And the ajax called would be something like
xmlgen.php?areaname=London%20Bridge&routerun=1

I hope this is clear enough. I don't see the code you have in xmlgen.php, so I can't tell you exactly what php code you should write, but that is the general direction that you can follow.

Dave
Reply With Quote
Reply

Bookmarks

Tags
html, php, query, sql


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
PHP Downside--Solutions? Amulet PHP 10 07-15-05 08:26 AM


All times are GMT -5. The time now is 08:47 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.