Solved

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

Posted on 2008-06-25
2
220 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Creating and Managing Databases with phpMyAdmin in cPanel.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

776 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