Questions tagged as 'pdo'

2
answers

Form recording the same data

Good afternoon guys. I have a problem that I can not find a solution for. I made a form to save the registrations of a web site, but many times the same registration is saved several times (see print) Ivalidatetheentireformsoasnottoriskgi...
asked by 30.11.2015 / 18:06
2
answers

How to insert the ID in the bank since it is the first field of the table?

I have auto increment ID and am having error counting columns with this code. How do I enter the ID together? #SQL Execute $uir = $pdo->prepare("INSERT INTO visitados VALUES (:IMO_CODIGO, :CATEGORIA, :BAIRRO, :FOTO_PRINCIPAL, :VLR_V...
asked by 29.09.2014 / 23:54
1
answer

PDO accentuation problem mysql php

I'm using this class to manipulate records in MySQL using PDO link But I enter ééé and enter éé into the bank the bank is uft8 the script header is in uft8.     
asked by 09.03.2015 / 21:09
1
answer

Login using PDO

I'm developing a login system with pdo for learning, but it always accuses the password. Follow the code: <?php session_start(); include "../../lib/inc_con.php"; $pdo=conectar(); $validarlogin = $pdo->query("...
asked by 19.12.2015 / 01:12
2
answers

PDO Statement Questions

I would like to know if when I use the queries for SQL commands with PDO I need to use bind() : $SQL->bindValue(1, $email, PDO::PARAM_STR); // Seria algo assim? For example in this case: $searchSQL = $pdo->prepare('SELECT emai...
asked by 08.03.2017 / 15:36
2
answers

How to insert the connection inside the functions without repeating the instructions?

Since I have several functions that will use this connection, how do I insert the $pdo into the function without copying the require and $pdo into each of the functions that I will elaborate? require("classes/Database.php"...
asked by 09.11.2015 / 15:24
2
answers

PHP does not recognize connection as parameter

I'm doing a system using MVC (the first time I use it in PHP), and when I go to login it appears:   Uncaught ArgumentCountError: Too few arguments to function Login :: login (), 2 passed in C: \ wamp64 \ www \ php_pdo \ controller \ logincont...
asked by 14.07.2018 / 05:33
1
answer

PDO connection to bank

Well guys, I'm starting to study about PDO, but soon in my first activity there is an error, all the information is below. CODE Object.php <?php $cli = new Produtos(); $cli->insert(); CODE Product.php <?php class Produtos ex...
asked by 04.06.2015 / 05:46
2
answers

Connection with database - PDO

In the course, we are manipulating database with PDO, but now in the connection part, the MYSQL_ATTR_INIT_COMMAND appeared to me and I do not quite understand what it is for, just know that the PDO instance requests this in the options. But wha...
asked by 26.07.2017 / 04:10
1
answer

Error using PDO prepare () function [closed]

I'm in a new project, and I need to use prepare() of the PDO, I do not know why, but only with it that is giving this error, every time it has some function, or some line with prepare() , PHP returns an error. I have already sear...
asked by 17.11.2016 / 07:48