How do I create a search engine people by postcode?

  • ecarreras
  • Newbie
  • Newbie
  • ecarreras
  • Posts: 5

Post 3+ Months Ago

Hello,

Probably this issue has already been answered but I have not managed to find :(

I was touched maintain the website of a non-profit association of reflexology and the web desing and programming is not my best virtues, but good attempt because they can not pay anyone >

I've been asked to put them on their web browser. Basically would put the city or zip code and they should leave a list of reflexology near that zip code.

The serious internal database created by myself.

As you see I have no idea where to start or that any help would be very useful

Sincerely

Enric
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • casablanca
  • Proficient
  • Proficient
  • User avatar
  • Posts: 481

Post 3+ Months Ago

You need a server that supports some scripting language - the most common and the one I recommend is PHP.

The code for your purpose should be pretty simple. Since you already seem to have a database ready, you just need a small script to pull out records from the database based on the zip code.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

What type of Database is it ... SQL, MySql, Access? Also, what type of hosting do you have, because not all windows hosts support PHP ... ?
  • ecarreras
  • Newbie
  • Newbie
  • ecarreras
  • Posts: 5

Post 3+ Months Ago

Thanks for answering,

The database is not done yet, I have the information on paper :) , My server supports PHP and MySQL.

but I do not have any idea how to create this scrip :( if I could give me a tutorial or something more or less done so that I could adapt it to my page.

would be very grateful
  • casablanca
  • Proficient
  • Proficient
  • User avatar
  • Posts: 481

Post 3+ Months Ago

A search for PHP MySQL tutorial returned this: http://www.php-mysql-tutorial.com/ and it seems pretty good.

For your purpose, you wouldn't need to delve too deep into PHP code. Something like this should be sufficient to just pull a record from the database:

Code: [ Select ]
mysql_connect(server, username, password);
mysql_select_db(your_db_name);

// Assuming $zip is the input zip code
$result = mysql_query("SELECT * FROM table_name WHERE zip = $zip");

while ($array = mysql_fetch_assoc($result)) {
// do something like displaying the result fields
}
  1. mysql_connect(server, username, password);
  2. mysql_select_db(your_db_name);
  3. // Assuming $zip is the input zip code
  4. $result = mysql_query("SELECT * FROM table_name WHERE zip = $zip");
  5. while ($array = mysql_fetch_assoc($result)) {
  6. // do something like displaying the result fields
  7. }
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

and just so you know ... inside that while loop, you would call a column name like this:
Code: [ Select ]
while ($array = mysql_fetch_assoc($result)){
echo "Name: " . $array['user_name'];
}
  1. while ($array = mysql_fetch_assoc($result)){
  2. echo "Name: " . $array['user_name'];
  3. }

where user_name is the column name in the MySql Table.
  • ecarreras
  • Newbie
  • Newbie
  • ecarreras
  • Posts: 5

Post 3+ Months Ago

Thank for the answer, i´ll go to check it out

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 166 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.