Questions tagged as 'pdo'

0
answers

Idea for cleaning and data-processing library

I need to make a library for data processing, so I can use it before calling functions such as: Register, Change, Delete and etc ... I am using PDO for communication with the mysql database, and the method itself already has some security mea...
asked by 17.09.2017 / 13:50
1
answer

Error inserting into MYSQL via PDO [closed]

I recently started in the area and I came across this situation. This code is not inserting in my MySQL. <?php try{ $pdo = new PDO('mysql:host=localhost:3306;dbname=formularioecofin', 'SECRETO', 'SECRETO'); } catch (PDOException $e ) {...
asked by 24.09.2017 / 15:44
0
answers

Generic Crud with phpoo and pdo (without framework)

I want to make a kind of Generic Crud and I implemented the insert function, I know that the way I did it is not the best way to do it and I do not want to use any kind of frameworks and so I would like help, tips. > What else is causing me co...
asked by 14.09.2017 / 03:42
0
answers

Conversion to PDO

I would like your help to turn the following code into PHP PDO. I made the following conversions and commented the front of the code, just to heal the doubt itself. Will the conversion be correct? <?php function retorna($cod_material, $...
asked by 20.11.2017 / 21:16
0
answers

Display image stored in blob with PDO? [duplicate]

I have stored an image using the BLOB field of MySQL ( LONGBLOB ), but I can not display it in html : //Instanciando minha classe com PDO e fazendo um //SELECT de todos os dados da tabela, inclusive a imagem <?php $...
asked by 31.08.2017 / 22:29
0
answers

The program does execute, but does not add to the database. I'm using PDO

This is the code I'm using by doing an update , but it does not update, and to help, it does not return any errors. $atualizaFilme = $pdo->prepare("UPDATE noticias SET ativo = ?,titulo = ?, descricao = ?, audio = ?, anofilme = ?, imdbid =...
asked by 09.09.2017 / 01:04
0
answers

PHP PDO drivers for SQL Server

I had the same problem, I performed the steps indicated, but I did not succeed in installing the SQL Server connection. Versions: PHP = 5.6.21; SO = Windows Server 2008 R2 Enterprise SP1. I have installed the following components:...
asked by 17.08.2017 / 15:35
0
answers

1452 Can not add or update child row: a foreign key constraint fails

SQL Query:    INSERT INTO tributos_prod (code, ncm, description, price, quantity,   v_total, situacao_trib_icms, t_tar_icms, aliquota_icms,   credito_icms, situacao_trib_pis, base_pis_value, aliquota_pis,   value_pis, situation_trib_cofins, v...
asked by 02.08.2017 / 22:39
0
answers

SQLITE login help

I'm doing a simple login here via SQLite, but when I hit the "Enter" button, it says " Login Failed ") everything is correct in the form; $sqlite = "sqlite:teste.db"; $pdo = new PDO($sqlite); $username = $_POST['login_username']; $password...
asked by 03.07.2017 / 00:57
1
answer

Changing data with PDO but does not update in the database

My form looks like this: // pega o ID da URL $id = isset($_GET['id']) ? (int) $_GET['id'] : null; //Valida a variavel da URL if (empty($id)){ echo "ID para alteração não definido"; exit; } $sql_selecao = "SELECT * FROM veiculos WHER...
asked by 30.06.2017 / 15:03