Questions tagged as 'pdo'

2
answers

PDO Array mySQL with Json display error

I'm having a hard time json_encode echo json_encode($autocomplete -> fetchAll(PDO :: FETCH_ASSOC)); I'm doing a select from the database so fine, but when it transfers the data to this echo from above, many characters appear that javascr...
asked by 03.03.2016 / 17:41
1
answer

Pass GET parameter through AJAX to activate page

I need to do the redirect after doing some commands in php I need to load an ajax. The link you submit to PHP: href="ajax/deletaPessoaVinculo.php?a=1&c=MEMBR&pb=3&p=vinculo.php?c=MEMBR" After this I get in the php of the dele...
asked by 19.01.2016 / 18:49
1
answer

Run 2 queries at the same time is it possible?

I need to change all the fields in a table and insert only one row in another row. I am using the following code $Nid = intval($_GET['Nid']); $sql = "UPDATE * FROM programacao SET status='offline' WHERE status ='online' "; $sql2 = "UPDATE pr...
asked by 20.02.2016 / 00:55
1
answer

How to manipulate data coming from the bank using PDO

I'm starting to use PDO in my projects in PHP. When I worked with mysql, without PDO, when I got a query in DB, I was able to get every data associated with a variable and could do what I wanted with it. Now using PDO, how can I do this data man...
asked by 29.10.2015 / 19:39
1
answer

Insert function is not working

I have the following class in php: <?php class contaEntrada { public $mostraDados; public $insereDados; function conectar(){ $host = "localhost"; $user = "root"; $pass = "root"; $dbname = "fluxo_de_caixa"; try {...
asked by 04.11.2015 / 18:09
1
answer

How to solve the prepare error of this script? [closed]

I am 2 hours looking for a solution to this problem ] [1]. I'm starting a Virtual store with PHP course and the error is as follows: it says I'm trying to give prepare strong> to an object not instantiated. The logic is this: he made t...
asked by 20.12.2015 / 01:15
1
answer

Data format php pdo [duplicate]

Input: <html> <form action="../controller/progPrecontrole.php" method="POST" onsubmit="return valid();"> <input type="hidden" name="id" value="<?php echo $id; ?>"/> <p>Data Saída:</p> <input...
asked by 18.01.2016 / 20:15
1
answer

How to return all results from the [PDO] database?

I'm doing a function to return all results from a database. The function in this exact format returns only one result but putting echo in each statement returns all the results. How can I make this code that probably has a logic error...
asked by 24.09.2015 / 01:39
3
answers

Uncaught exception error PDOException with message 'SQLSTATE [HY000]: General error: 2014 [closed]

I have a code that works perfectly on the local server wampserver, it is a query interspersing the results the problem is that when I finish the site and host it I get an error. The code is this: $conn->exec('SET @orderA := 0; SET @order...
asked by 21.08.2015 / 03:04
1
answer

problems with infinite loop using PDO :: FETCH_ASSOC

My Query $sql = "SELECT * FROM tablename WHERE algumvalor=2 LIMIT 1"; You are entering an infinite loop here How do I use while ? while($row_data=$conn->executaQuery($sql)) { var_dump($row_data); } W...
asked by 11.09.2015 / 23:50