Questions tagged as 'pdo'

0
answers

Insertion and removal using PDO in OneToMany and ManyToMany relationships

I beginner questions about insertion and removal using PDO in relationships of type OneToMany and ManyToMany . Example: class Livro{ private $id; private $titulo; private $generos; //Livro tem mais de um genero } class Genero{...
asked by 29.05.2018 / 21:28
1
answer

PDO SQL Injection Doubt

I'm venturing a bit with PDO, still in the beginning, and I have a question regarding a query with SQL Injection, it follows: $insert = "INSERT INTO tabela (campo1, campo2, campo3) VALUES (:valor1, :valor2, :valor3)"; $db = new db(); $db = $...
asked by 19.05.2018 / 23:26
0
answers

Delete orphaned files

I have a content management system that I use on my car shop site, it has 3 tables that are dependent, Shop, Cars, and Cars. When registering a store, I add a car and several photos of that car, all in their corresponding tables, but I notice...
asked by 23.05.2018 / 05:52
0
answers

ho to first query the database and build the form in the page, based on the retrieved json string

$(document).ready(function(){ load_data(); function load_data(query) { $.ajax({ url:"fetch.php", method:"GET", data:{query:query}, success:function(data) { $('#result').html(data); } }); }...
asked by 13.05.2018 / 23:29
1
answer

PDO eliminates duplicate SQL fields

Good luck, I'm using PDO to run my querys . SQL: SELECT Pessoa.IdPessoa, Pessoa.IdPessoa, Pessoa.Nome AS 'Nome', Pessoa.DataNascimento AS 'Nascimento' FROM Pessoa WHERE Pessoa.EstadoCivil = '1' When I run this sql for example, whic...
asked by 08.05.2018 / 22:52
1
answer

How to insert data into related tables using PDO

I did a lot of research, but I do not know how to apply.     
asked by 24.04.2018 / 15:53
1
answer

Error making a dynamic insert in PHP

The code that is causing the error: public function Inserir($tabela,$sql){ ksort($sql); $Campos_nome= implode('', '', array_keys($sql)); $Campos_valor= ': '. implode(', :', array_keys($sql)); $novo=$this->prepare("INSERT...
asked by 28.05.2014 / 11:18
0
answers

How to send multiple image to DB?

Personal as you can see this is a piece of my cod I'm just sending the name of the property, forget the id_imovel because it is something else, I'm trying to send several images to the db, but when I send to the db it creates 2 times the msm...
asked by 10.04.2018 / 03:57
2
answers

SQLSTATE [HY093]: Invalid parameter number problem in insert

I need to insert the following data through a form: TITLE DESCRIPTION PRICE HTML: <?php session_start(); session_destroy(); ?> <html> <head> <meta charset="UTF-8"> <title></title> &l...
asked by 17.05.2015 / 10:12
0
answers

Do not save Array of value 0 in the database

guys, I have a form with 'n' quantities of inputs, all with the same structure: echo "<input name='quantidade[]' type='number'>"; When I finish the form and send it to the next page, it arrives to me in array, and I use this array to...
asked by 04.04.2018 / 21:56