Questions tagged as 'pdo'

1
answer

PDL sqlsrv is in phpinfo but does not work

I'm trying to access a SQL server from another Ubuntu 16.04 server using PHP, I made the entire drive installation process informed by Microsoft's own website and in phpinfo the installed drive is shown as shown in the images, however when I go...
asked by 24.03.2017 / 14:12
1
answer

Query with array returning only first record

I have the following querys: <?php $VarMensagem = 1; $pdo = new PDO($dsn, $un, $pwd, $opt); $data = array(); $dataGeral = array(); try { $stmt = $pdo->query("SELECT * FROM mensagem WHERE me...
asked by 14.03.2017 / 04:23
1
answer

Remove Mysql record with PHP [closed]

I have a PHP page with connection to Mysql. Everything works perfectly, however I have a DELETE button, which when I click it, takes the ID of that entry, goes to a del.php page and should remove this entry in Mysql. However, "it seems" that cli...
asked by 27.02.2017 / 22:45
1
answer

Function in MySQl PDO for json [closed]

I'm taking the first steps in MySQL PDO and I have 2 questions in my code. The first is related to the efficiency of the functions. The second doubt is related to the return of results from a database to insert into json_enc...
asked by 23.01.2017 / 05:12
2
answers

Recording data from a SESSION in BD [closed]

Hello, I would like to add the registered_name to the database. <?php require_once("../../../session.php"); require_once("../../../class.user.php"); $auth_user = new USER(); $user_id = $_SESSION['user_session']; $stmt...
asked by 09.01.2017 / 15:45
2
answers

PHP PDO Notify user whose registration name already exists

Hello. The code below does not allow the user to choose a name already used. But I would still like to warn the user that they chose the wrong name so that they know they need to choose another name. include_once 'database.php'; // Verifica se...
asked by 29.11.2016 / 22:15
1
answer

How to remove the Fatal error: Uncaught Error: Class

Hello, I am creating an inventory system and it is always giving this error, Fatal error: Uncaught Error: Class 'cRelatorios' not found in C:\xampp\htdocs\Projetos\relatorios.php:170 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Projetos\r...
asked by 26.12.2016 / 17:52
1
answer

Structure Array coming from mysql with PDO (organize)

Good evening, I'm having a difficulty with arrays where I'd like them to stay in order so I can use them as follows. In my database I have many images that I call with this code below. <?php $image_search = 00001::conect_sql(); $image_s...
asked by 09.10.2016 / 00:48
1
answer

How do I get the PDO to list the Array with the Correct Types?

In MySQL I write data in a table defining some fields as int or float , but when I make a select in the database via PDO the array comes all as a string. Is there a function that forces the type to be returned as it is...
asked by 19.09.2016 / 22:45
1
answer

mysql transaction error in php

Good morning, guys. I'm trying to do the simultaneous insert, I'm using transaction control in php, but it does not do the first insert, so it generates a foreign key error. public function insert(){ try{ self::getInstance()->b...
asked by 13.10.2016 / 13:52