Questions tagged as 'pdo'

1
answer

What are the advantages of PDO :: FETCH_OBJ?

What are the advantages of using PDO :: FETCH_OBJ? I know that I get an object instead of an array, but what are the performance advantages of the code?     
asked by 08.09.2014 / 13:18
1
answer

Doubt about the doctrine \ dbal project structure

I read the Documentation the only thing I did not understand was as is the structure of it. I explain: My file composer.json in the project root { "require": { "doctrine/dbal": "2.4.*" } } When you run the command: p...
asked by 05.09.2014 / 22:54
1
answer

insert in batches using pdo and transaction

Good morning guys, I'm kind of new to the world of php mysql and I'm in need of a help I am inserting data into my bd into 6 tables, the data comes from txt files Some files have 5000 rows with 163 records separated by; That's fine, I c...
asked by 22.08.2014 / 16:06
1
answer

PDO insert does not work

Before you ask me the question, I have already consulted other topics here from the OS and found no solution. I'm trying to make a simple insert and as soon as I squeeze the whole script simply nothing happens, the screen remains blank. I alread...
asked by 03.10.2014 / 21:38
1
answer

Array only loads last record in PHP with PDO

I'm generating the information, but only fills the last line of the query executed inside the Array, even though I'm sure it's running all the rows in the foreach. Any ideas how to populate all the arrays with all the information? <?php hea...
asked by 11.08.2018 / 21:36
1
answer

Get value from the right set with 'ambiguous' fields

I'm doing the following query to my database: $escalacoes = 'SELECT * FROM escalacoes AS e JOIN jogador_rodada AS jr ON e.id_jogador = jr.id_jogador WHERE e.rodada = ('.$rodada_atual.' - 0) AND jr.rodada = '.$rodada_atual; $escalacoes...
asked by 08.07.2018 / 00:42
1
answer

Insert Data into PHP PDO Database

Good evening, I'd like some help with my code. I'm trying to insert some data, coming from a form, into the database. Here is the code: insertCadastro.php session_start(); include_once("settings.php"); //Verifica se clicou no botão $envi...
asked by 02.05.2018 / 01:31
1
answer

FETCH_CLASS does not display parent class values

I'm using FETCH_CLASS to map classes, but when for example one class inherits another, FETCH_CLASS does not find the attributes of the parent class and ends up creating new attributes class UsuarioVO { private $id; private $nome;...
asked by 31.03.2018 / 04:11
1
answer

Product Registration with Select Multiple does not insert all selected

The registered items have several flavors, chocolate, strawberry, vanilla, etc., and each one is inserted by select multiple in the register, it is saved as "chocolate" but the other selected flavors are not inserted. PHP Code if (...
asked by 30.12.2017 / 18:27
1
answer

Sql Injection in Stored Procedures

SQL injection in Stored Procedures , especially when calling a Procedure by PDO of PHP ? DELIMITER // CREATE PROCEDURE procedureTeste( string VARCHAR(255) ) BEGIN SELECT * FROM produtos WHERE nome = string; END // DELIMITER ;...
asked by 01.03.2018 / 01:12