• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

How do you Query a Database using an Image Map and PHP

I am using Dreamweaver CS3, PHP5 and MySQL 5 (I think). I have a database with several tables and can display the data on web pages created with Dreamweaver by selecting pages from the site navigation.  Each page has a table tied to a query using Dreamweavers recordset behaviour.

I have a table called suppliers and would like to return the list of suppliers in specific countries by clicking hotspots on a map of the world. Is this possible?

Im guessing this is something to do with parameter queries, but as Im new to this I dont know where to start.

Can anybody help please?

0
ianwills
Asked:
ianwills
1 Solution
 
mankowitzCommented:
First you make an image map.. see http://www.graphicsacademy.com/howto_imagemap2.php

Then, once you get the state they clicked on, your SQL will look something like this
SELECT * FROM table WHERE state=xxx

An example:
in php, suppose the imagemap field was called "state"
$result = mysql_query("SELECT * FOM table WHERE state='{$_POST['state']}'")
0
 
ianwillsAuthor Commented:
Thanks Mankowitz, that a great help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now