PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The specific line would set a variable $query to the string (after $id is parsed).
When given to a database it would, provided the table and column references are legal and $id is a valid value, would request all the columns (in the table 'map') from each record where the field 'id' matched $id.
that would depend on where that statement is and whether you have register_globals on or not.. (they should be off) .. In which case, you would need to create $id, either via using $_GET['id'] or some other (magical) way.
if (isset($_GET['id']) ) {
$id = intval($_GET['id']); // this makes sure nothing nasty is being injected into you SQL
if ($id > 0) {
$query = "SELECT * FROM `map` WHERE `id` = $id";
$result = some_database_query($query);
// check if the query returned any rows
// if so then fetch data
} else {
// set error message here for "not valid id"
}
} else {
// set error message here for "no id passed"
}
Looks to me like this will just queue the database to the id specified in the address line... so it can do whatever you want it to do by adding your code into the second if statement right about where the "//if so fetch data" comments are.