Questions tagged as 'pdo'

0
answers

Function to filter data from one table by date

I have a table in the database and I need to do a function to filter by date. I want to fetch the records from a date that has already passed and that I would return the records from the bank table as they were on that day and that I can edit th...
asked by 01.02.2016 / 13:27
0
answers

How to make the data return in php array

I need to return the data in an array. I'm doing this, but the data does not return: <?php ini_set('display_errors', true); error_reporting(E_ALL); include_once("conexao.php"); $pdo = conectar(); header('Content-Type: application/json');...
asked by 29.12.2015 / 12:12
1
answer

List two mysql tables pdo

$catalog = $dbh->prepare("SELECT * FROM catalogo WHERE ativo = 2 ORDER BY catalogo_view DESC LIMIT 0,5"); $catalog->execute(); I want to search between two tables, how do I?     
asked by 26.02.2016 / 19:09
1
answer

How to do an INSERT within the while

Hello, How do I do an INSERT within a loopback where comment id = comment id looks at the code $selecionarComentarios = $conexao->prepare("SELECT a.id_mark, a.id_user, a.comment, a.rate, a.id, a.active, b.name, b.avatar FROM tb_com...
asked by 13.01.2016 / 06:02
1
answer

problems with bindValue

$query = "INSERT INTO " . $this->table_name . " (data, sexo) VALUES (:data,:sexo)"; $stmt->bindValue(':data', $_REQUEST['data']); $stmt->bindValue(':sexo', $_REQUEST['sexo'...
asked by 11.01.2016 / 18:36
0
answers

Table-wise query using PDO

My seemingly simple problem has given me headaches. I have a table that contains three columns: id , idpergunta , resposta . When a reply is sent to be inserted in this table I check if it already exists: $where = [...
asked by 25.01.2016 / 23:34
0
answers

Doctrine2 + pdo_sqlsrv createQueryBuilder Order By with varchar field does not work

I'm creating a method that gets values for createQueryBuilder () coming by parameters. I tested it in my local database with pdo_mysql driver and it worked perfectly, by ordering both an int (id) field and a varchar (title) type field. Howe...
asked by 02.12.2015 / 20:44
1
answer

PDO bindParam error

I have a function of UPDATE that receives table, array of columns, values and where, I do the treatment: //montar SQL $totalValores = count($valores); //conta quantos valores $expressao = null; for($i = 0; $i < $totalValores; $i++) {...
asked by 24.12.2015 / 00:40
2
answers

I can not do update because it is not retrieving the id php pdo

Here is to recover in html : if(isset($_GET["id"])){ $administrador = new Administrador(); $mostrar = $administrador->listar_id($_GET["id"]); } <form action="Crud.php" method="post" id="none">...
asked by 21.12.2015 / 13:52
0
answers

Save multiple PHP and PDO textarea data

Good morning, I have the following script that I need to save all textarea data line by line but the script saves only the first line and ignores the rest I get the data like this in textarea 0001:0001:0001:0001 0001:0001:0001:0001 0001:...
asked by 24.10.2015 / 11:16