Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

14 Experts available now in Live!

Get 1:1 Help Now