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

125
Visualizações
Store array value in Database frontend angular2 backend php?

Hello first of all sorry if this question already ask? But I am stuck in this what exactly I want to is. I am trying to create a rest api for my angular2 frontend. All works fine as I called rest api and from angular2 and start database value in particular table. like

$stmt = $db->prepare("INSERT INTO `create_profile`(`developerType`, `skills`, `level`, `workType`, `message`) VALUES (:developerType, :skills, :level, :workType, :message)");$stmt->bindParam(':developerType', $params->developerType);

But I am stuck how to store a value which contains array at the place of value like in my skills table there is an array with 2 values but how can I store it into database.

I am using like this ..

$stmt->bindParam(':skills', $data);

but its not working I know I missed something but what that I don't know. please help me

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

you can try

$data = array();
$skillSet = $params->skills;
foreach($skillSet as $team)
    $data[] = "" . addslashes($team->skillName) . "";

$data = implode("," , $data);

$stmt->bindParam(':skills', $data);

you have to implode your array first and after that it can be store in the database hope it will help you.:)

about 4 years ago · Santiago Trujillo Relatório
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