Most voted "pdo" questions
The PHP Data Objects (PDO) extension defines an interface for accessing PHP databases. Each database driver that implements a PDO interface can expose database-specific features as normal extension functions.
Learn more…927 questions
Sort by count of
-
-2
votes2
answers90
viewsForeach returns nothing back
I have a database query that returns an object to me Array ( [0] => stdClass Object ( [id] => 3 [status] => pending [task] => drink juice ) [1] => stdClass Object ( [id] => 17…
-
-2
votes1
answer39
viewsError in PDO embedded
Hello, I have the following code: public function insert($nome,$email,$senha,$cluster,$situacoes_id,$niveis_acesso_id,$empresa,$modified,$area,$escritorio,$contrato,$regional) { $stmt =…
-
-2
votes1
answer133
viewsDoubt in listing items with PDO and PHP 7
Hello, I’m trying to make a listing using PHP 7 and PDO and I’m not getting it. Until then I made this code <?php $con = new PDO("mysql: dbname = banco; host = localhost", "root", "senha"); $sql…
-
-2
votes1
answer72
viewsSQL code with php PDO bindValue returns a simple quotation marks inside the IN in SQL
Next, I am developing a fuel system, specifically in the part of filters for generating a custom report it returns me an IN('1,2,3') with simple quotes It all starts in the form, in which I have a…
-
-2
votes2
answers74
viewsproblem in sending php form data to Mysql database
Hello, I am beginner in PDO and in my development of a form I can not send anything to the database and I can not identify the problem in my php form, someone could help me please? FILE…
-
-2
votes1
answer26
viewsI can’t use "use Pdo"
my project is not working because it gives the following errors: Warning: include(Models PDO.php): Failed to open stream: No such file or directory in C: xampp htdocs Resumeai index.php on line 3…
-
-2
votes1
answer30
viewsClose an execution or not when there is a Pdoexception error?
When implementing Pdoexception is there a need to use die or Exit to complete execution in case of errors? or just return an "echo" stating the error and let the execution of the script follow? My…
-
-3
votes1
answer1783
viewsSolution for while in HTML structure
Someone has a simple solution to loop while in PHP to the following HTML structure? Basically I want every 3 Ivs to have one <li> separating them so that the slide can function properly, since…
-
-3
votes1
answer305
viewsSingle user registration and password converting mysql_* to PDO
I need to update a legacy code and for that I need to make two modifications to it. The first change is to leave office mysql_* and use the PDO. The second is to update the database so that I can…
-
-3
votes1
answer429
viewsUpdate with Multidimensional Array
I’m having a terrible problem, I can’t update mysql via PDO, with array that comes from some form fields. I’ve tried a lot and so far I can’t update. The array comes in this format. Array ( [id]…
-
-3
votes1
answer40
views -
-3
votes1
answer58
viewsWhy, only part of the data, appear in php?
I am doing a select, in a table of my database, to get all messages from all users. However, only 1 user messages appear, others do not! php: <?php ini_set('display_errors', true);…
-
-3
votes1
answer272
viewsMultiple Inserts Inner Join PDO
Hello, I have in DB the tables categoria and imagens Currently Function (in PHP) to insert in the category table is similar to this (same title only): public function insere($ttitulo) { try { $stmt…
-
-3
votes1
answer64
viewsError when displaying the sum in a SELECT
I’m not getting the total amount. View Bench Values that are in the bank: R$ 70,88 R$ 70,88 R$ 70,88 Value that appears R$ 210 Value that has to appear R$ 212,64 Code <?php $numerocontrato =…
-
-3
votes1
answer295
viewsdatabase query returning empty array
Hello, I have an appointment function at the bank. If the query returns 1 or more rows, the function returns an object (or a class), but if the query does not return any rows, the return is: Array (…
-
-3
votes1
answer63
viewsHow to ensure the Insert of all MYSQL data
I need to ensure that ALL data is entered, otherwise carry out a reversal and those that are entered are removed. I have the following case $dia1_entrada = $_POST['dia1_entrada']; $dia1_pausa_almoco…
-
-4
votes2
answers222
viewsPDO and mysqli are the only options to work with PHP database?
And if I needed to use a database that wasn’t supported by PDO, what I could do? After all, what does PDO do underneath the scenes? It uses mysqli?
-
-4
votes2
answers90
viewsHow do I upload the image and delete the old one?
How do I delete old image and upload new image? The code I’m using uploads, only the old and current image is in the folder... $novoNome = $img; if(isset($_POST['edit_profile_avatar'])) {…
-
-4
votes2
answers387
viewsSave atomatic in PHP does not work with Success and serialization
A code that performs the autosave of data on a form works so: autosave.php <?php require_once '../multiinjet/web/includes/configuracao.php'; try { /*Pegar valores postados no formulário*/…
-
-4
votes1
answer56
viewsError when inserting into BD
Guys, I’m having a problem registering customers in the comic book. When I click the sign up button, it just refreshes the page and does not insert the client in the comic book. No error and…
-
-4
votes1
answer878
viewsSQLSTATE[08004] [1040] Too Many Connections
This is my connection class: /** * Conn.class [ CONNECTION ] * Abstract connection class. Singleton standard. * Returns a PDO object by the static getConn() method; * * @copyright (c) 2017, Horacio…
-
-4
votes1
answer47
viewsUse PHP PDO for search
Where is the error in my code. I do not know why it does not return the search result. <?php require_once('db_connect.php'); $conectar = new…
-
-4
votes1
answer149
viewsView photo registered in the bank
I want to display a photo registered in the database that was registered in a type blob attribute. However I do not want to display the photo through a link where you click and open the photo, on…
-
-5
votes1
answer449
viewsPDO connection file. How to use?
I have a PDO connection file. To include this connection in other system files in order to make the requests in the database, I will use this???? <?php require('conexao.php'); ?>…
-
-5
votes1
answer178
viewsError in SQL query with PDO
I can’t make the query, when I try to make it, I get the error: Erro PDOStatement Object ( [queryString] => SELECT userid FROM usuario WHERE email=:email and senha=:senha ) <?php…
-
-7
votes1
answer105
viewsRefer to PHP PDO user
For those with the doubt as I had, below I’ll leave the code ready, just change to your project. The code is simply to know the user logged in and say his name in PHP PDO. If your project is by…
-
-8
votes1
answer79
viewsInsert Into Does Not Send Values
I have this code to send values to a table in the database, it is not displaying any, it is simply not sending values <?php include "../../lib/inc_con.php"; $mesa = $_POST['mesa']; $tamanho =…