Solved

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

Posted on 2008-06-25
2
219 Views
Last Modified: 2013-12-12
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
Comment
Question by:ianwills
2 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 500 total points
ID: 21869618
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
 

Author Comment

by:ianwills
ID: 21878484
Thanks Mankowitz, that a great help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now