Questions tagged as 'pdo'

3
answers

Insert image into 2 different tables [duplicate]

I created a function to register images as if it were an album; A table for capa and a table for galeria . HTML: //Imagem da Capa <div class="form-group"> <label class="col-md-1 control-label" for="capa">Capa...
asked by 11.09.2015 / 17:36
1
answer

Get Sequence ID based on last inserted

I have a problem that is giving me problems. I have the following code: $sql = $pdo->prepare ("SELECT cpf,idUser FROM 'tblContacts' where cpf = '".$cpf."' limit 1"); $sql->execute(); $row = $sql->fetch(); if($row != null) {...
asked by 08.07.2015 / 17:28
1
answer

mysql_result equivalent in PDO

I am trying to pass from mysql to pdo but I do not understand how to pass that mysql_result to pdo, I appreciate any help available $limite = 10; $SQL_COUNT = mysql_query("SElECT COUNT('id') FROM anuncios WHERE categoria='$categoria' AND estad...
asked by 01.04.2015 / 18:54
1
answer

Prevent duplicate registration with PDO

I would like to prevent duplicate registration of the same source. The code used for registration is the one below: <form name="enter" method="post" action="" enctype="multipart/form-data"> <?php if(isset($_POST['enter'])){ $font = $_...
asked by 13.05.2015 / 15:12
2
answers

Use prepared statements and bound values to avoid SQL Injection with PDO?

I would like to know if it is safe to search the database like this: $c = $conn->prepare("SELECT * FROM tb WHERE coisa = :post"); $c->bindValue(':post', $_POST['login']); $c->execute(); var_dump($c->fetch()); Is it safe for me t...
asked by 24.03.2015 / 23:16
1
answer

Store data in the database using PDO :: commit

Hello ... I've never used PDO :: Commit, but now I see the need to use ... and right now, even following the php doc and some examples on the net, I can not store the data ... here's my code : connection.php class Conexao extends PDO {...
asked by 23.02.2015 / 09:43
1
answer

Organization of portfolio by categories

Looking at the MODEL , I would like some simple suggestion to classify these blocks by categories dynamically with the same effects already existing. Home I have a table that saves the id of the "product" and its ids of the categories related...
asked by 04.08.2014 / 00:05
2
answers

Doctrine DBAL version dev

See only the dev version is paid:? I'm talking because it's causing me an error:    "C: \ bin \ composer.bat" "--ansi" "--no-interaction" "validate"   ./composer.json is invalid, the following errors / warnings were found:   description: NULL...
asked by 05.09.2014 / 15:25
2
answers

How do I make the return of a query (PDO) already bring me an array ready?

I that I have: Periodo | Cliente _________________________ jan2014 | Cliente A jan2014 | Cliente B I want what: array( 'jan2014' => array( 0 => 'Cliente A', 1 => 'Cliente B', ) )     
asked by 10.03.2014 / 19:54
0
answers

PDO - Join in a function

I am inserting a new query into a functional system, but I am not able to understand how to insert a JOIN , I saw the function exists, I just can not deploy it. I tried to run like this $query_cliente = QB::table('tbl_reclamacoes')->jo...
asked by 27.12.2018 / 13:09