PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old September 30th, 2002, 05:23 AM
shibumi shibumi is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 28 shibumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to shibumi Send a message via Yahoo to shibumi
Query Form

What I'm trying to do is query a database (MySQL) for zip code matches. I can build a page that lists them as soon as I go to the page, and allows me to edit them and update them, which is great, but I have had no luck building a form where someone could enter in any given zip code and find info about it (i.e. what state and/or city its in). I have been poking around for even a tutorial but had no luck. Anyone by chance know of a good tutorial on this subject or some example code I could learn from? Thanks in advance for any help you might have to offer.

Reply With Quote
  #2  
Old September 30th, 2002, 05:33 AM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Query Form

SELECT * FROM table WHERE zip_code = '{$_POST['zip']}'

that will find zip codes that match it exactly...

Reply With Quote
  #3  
Old October 1st, 2002, 11:41 AM
shibumi shibumi is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 28 shibumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to shibumi Send a message via Yahoo to shibumi
RE: Query Form

Excellent, thanks for that D1NGO =)

Reply With Quote
  #4  
Old October 1st, 2002, 10:04 PM
shibumi shibumi is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 28 shibumi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to shibumi Send a message via Yahoo to shibumi
Digging a little deeper...

That code you gave me worked perfectly, thanks again for that. Another question though if you or anyone else has the time...

Could you also with php find near matches? I can't even begin to think how I'd go about that. For example, would you tell it to look for something like 9810* or even 981** or 98***? Now that would be pretty sweet. Anyone have any ideas/know how on that?

All help graciously excepted as always =)

Reply With Quote
  #5  
Old October 2nd, 2002, 01:09 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Query Form

Code:
SELECT * FROM table WHERE zip_code LIKE '{$_POST['zip']}'


and just enter starting digits, ie "98"

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Query Form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway