Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

258
Visualizações
Modifying data in PostgreSQL using javascript AJAX single quote error

Modifying data in PostgreSQL in javascript where URL contains a single quote

What would be the best way to approach this problem?

In some of these approaches, success is printing but there are no changes to the database.

Attempts

first_name = D'Angelo
first_name = D%27Angelo
first_name = D\'Angelo
first_name = 'D''Angelo'
first_name = D\\\'Angelo

database

 _______________________________
|first_name|last_name|is_present|
---------------------------------
| D'Angelo |Williams |  false   |
---------------------------------
| Georgia  | Fritz   |  false   |
---------------------------------
|   Luca   | O'Keefe |  false   |
 _______________________________

file.js

modify_student_data = "D'Angelo: Williams :false"
first_name = "D'Angelo";
last_name = "Williams";
is_present = "true";
$.ajax({ url:'/data/student_attendance/' + modify_student_data + "*" + first_name + ':' + last_name + ':'+ is_present,
    success: function (result){
       console.log("Success");
    }
    error: function (er){
       console.log("error");
    }
});

desired outcome

 _______________________________
|first_name|last_name|is_present|
---------------------------------
| D'Angelo |Williams |   true   |
---------------------------------
| Georgia  | Fritz   |  false   |
---------------------------------
|   Luca   | O'Keefe |  false   |
 _______________________________

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda