Questions tagged as 'pdo'

1
answer

How can I make a select in PHP with FIREBIRD PDO?

I've already made a correct connection to Firebird using PHP, however I'd like to know how I can do select in a certain bank. Can anyone help me please? <?php $user = "SYSDBA"; $pass = "masterkey"; try{ $lokos=new PDO("firebird:loca...
asked by 01.07.2015 / 20:19
1
answer

Bug on PDO? Table Disappears After INSERT Command, Like Debug?

Introduction I'm creating a library with some "magic methods" on the PDO , already I did this with MySQLi and it worked beautifully. The intention is to use it in a Framework that I am building , finally it comes from soap. Problem...
asked by 23.09.2015 / 22:52
1
answer

Error Object of class stdClass could not be converted to string

Well I'm with an 'X' object that one of its properties is a JSON. In this JSON it contains the column name and column value respectively. But I can have several 'X' objects, and so on. Today I'm doing it as follows: PHP: public function...
asked by 05.12.2015 / 17:14
0
answers

Bind Param with Array - PHP and MySQLi

I have the code: <?php $clientes = implode(', ', $clientes); $busca = $mysqli->prepare("SELECT nome FROM clientes WHERE id IN (?)"); $busca->bind_param("s", $clientes); $busca->execute(); $busca->bind_result($nome);...
asked by 07.05.2018 / 14:05
2
answers

Problems with PHP PDO

Next, I have the following method in a class named UsuarioDAO . public function insertUser(PojoUser $user) { if ($stmt = Conn::con() != null) { $stmt = Conn::con()->prepare('INSERT INTO usuario (email, username, passwor...
asked by 27.08.2016 / 17:48
1
answer

Return error message for database queries with PHP

Is there any way to get error messages coming from the database when trying to run a Query with the PHP PDO? I have tried to put a try catch in the ->execute() method but the PDOException class does not capture anythin...
asked by 29.03.2016 / 22:42
1
answer

SQL does not return all results

I have 2 tables in MySQL, one called municipalities and another called municipios_ibge both have a column named municipio that holds the municipality of each city of Brazil. I have to do the following: I need to check if the municipalities...
asked by 15.08.2016 / 01:28
1
answer

Long Polling does not timestamp GET

I took this example on the blog link Server.php <?php header('Content-type: application/json'); require 'pdo.php'; set_time_limit(0); while ( true ) { $requestedTimestamp = isset( $_GET['timestamp'] ) ? (int)$_GET['timestamp'] :...
asked by 11.08.2015 / 21:18
3
answers

PDO :: Fetch & FetchAll

Because the following code works: $stmt = $pdo->prepare("SELECT * FROM dados"); $stmt->execute(); $codigos = $stmt->fetch(); echo $codigos['codigo']; So I can not use it? $stmt = $pdo->prepare("SELECT * FROM dados");...
asked by 05.05.2015 / 13:52
4
answers

How to perform query with some null values?

The SQL below returns the values correctly only if the data_emissao field is as not null in my DB table (regardless of whether the cliente parameter was passed or not), however I want to return the values where the data...
asked by 28.02.2017 / 22:00