Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:33:26+00:00 2026-06-11T15:33:26+00:00

I want to delete specific Markers from my database, I can save than with

  • 0

I want to delete specific Markers from my database, I can save than with an “ID”, I wan’t to use the same ID to delete from database,

For example, if I save 20 waypoints, the id of each marker will be (1,2,3,…,20)

I want to use this value on JavaScript and delete a specific line from the table on PHP code,
For example, if I click on a marker on my project, it will automacally delete from map and from database, I have a code here:

EDITED WITH MY TRY

 function bindInfoWindow(marker, map, infoWindow, html, deleta) {

  google.maps.event.addListener(marker, 'click', function() {
    infoWindow.setContent(html);
    infoWindow.open(map, marker);


  });
   google.maps.event.addListener(marker, 'rightclick', function() 
       {    
           marker.setVisible(false) 
              alert(deleta)
              deleteMK(deleta)
    });


}

function deleteMK(deleta)
    {
        alert("vai");
         var url2 = "phpsqlinfo_addrow.php?deleta=" + deleta;   
    downloadUrl2(url2, function(data3, responseCode) 

    {
        if (responseText == 200 && data3.length <= 1) 
        {
            document.getElementById("message").innerHTML = "Deletado";
            window.location.reload()
        }
    });     
    }

    var string2 = JSON.stringify(data3)
//Função ajax que salva os marcadores no mapa
function downloadUrl2(url2, callback) 
{
    var request2 = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
    request2.open('POST',url2);
    request2.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    request2.send('command=delete&marker='+string2)
    request2.onreadystatechange = function()
    {
        if(request2.readyState==4) 
        {   
            //infowindow.close();
            alert('Deletado')

        }
    }
}

PHP:

$deleta = $_REQUEST['deleta]'];

    if($_REQUEST['command']=='delete')
{
    $query = sprintf("DELETE FROM markers WHERE id='%s'",mysql_real_escape_string($deleta));



}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:33:28+00:00Added an answer on June 11, 2026 at 3:33 pm

    **What ever you do don’t use unescaped HTML in your query see tutorial

    USE**

    <?php  
     require("dbinfo.php");
    // Get parameters from URL
     $id = $_GET["id"];
    //Opens a connection to a mySQL server
    $connection=mysql_connect ($host, $username, $password);
    if (!$connection) {
      die("Not connected : " . mysql_error());
    }
    // Set the active mySQL database
    $db_selected = mysql_select_db($database, $connection);
     if (!$db_selected) {
      die ("Can\'t use db : " . mysql_error());
    }
    // delete the row in the table
    $query = sprintf("DELETE FROM *your table* WHERE *your field name*
    echo "<br>";
    echo $query;
    $result = mysql_query($query);
     if (!$result) {
      die("Invalid query: " . mysql_error());
     }
    ?> 
    

    You should also confirm delete in infobox

    I assume you are now using ID column (atocomplete} as I suggested in comment

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to delete an entry from my Database but it says it can't
I want to delete files from a specific directory recursively. So, I have used
I want to delete a specific phone number from an address book contact. It
How can I delete a specific row from an sql table? I have a
I want to delete line(s) from my TDBMemo field if it contains a specific
I want to delete one or more specific line numbers from a file. How
All, I want to delete specific array elements of one array from the other.
I want to delete several specific values from a matrix (if they exist). It
I want to delete specific rows from 8 tables. My problem is that the
I want to delete all entries from specific dates, but in my date field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.