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
-
1
votes0
answers103
viewsupdate does not work php
Personal I am making a panel in which the user sends an image, but this image is not being made require_once("../classes/seguranca.php"); $nome = $_POST['nome']; $foto = $_FILES['imagem']; $id =…
-
1
votes1
answer2072
viewsHow to resolve "Call to a Member Function prepare()"?
I’m finding the following error in script down below: Fatal error: Call to a Member Function prepare() on null in C: wamp www cursophp orientacao_object pdo_statement usuarios.php on line 20 Code:…
-
1
votes0
answers83
viewsPDO returning error when no error
Randomly, I get the following error while upgrading my system: Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Cannot assign requested address By error, it can not connect to the server,…
-
1
votes1
answer44
viewsNumber of fields - PDO
I built some crud classes in PDO and almost all have 4 or 5 fields in DB, worked correctly. Now I’m trying to create a crud of 6 fields, but does not create the record in DB at all, I rewrote the…
-
1
votes3
answers127
viewsHow to check if a select is null
Guys, I have this code that pulls info from the server try { $conecta = new PDO("mysql:host=$servidor;dbname=$banco", $usuario, $senha); $consulta = $conecta->prepare('SELECT * FROM…
-
1
votes1
answer455
viewsjson_encode returning empty
I am performing a basic query in the bank, using the following code: public function searchAllProducts(){ $array = array(); $select = $this->connection->prepare("Select * from tb_produto");…
-
1
votes1
answer587
viewsInsert JSON file into database via PHP
I have a JSON file that I need to do the Insert of the information contained in it in the database. JSON file:…
-
1
votes1
answer67
viewsHELP - I can’t identify error - PHP and SQL
Hello, I am trying to bring in a table the grouping of all stages and item evaluation per year along with the average scores and weights. I can only bring the last step and item p table, IE, is not…
-
1
votes0
answers515
viewsShow View output in PHP
Good night, I need to show the result of a view I created in Postgres, but I get no return. View in Postrgres: CREATE VIEW VW_RELATORIO03 AS SELECT EXTRACT (MONTH FROM DATSOLPED) AS MES, COUNT(*) AS…
-
1
votes0
answers195
viewshow to resolve Notice: Trying to get Property of non-object and delete a PHP PDO record
I have the following function to delete a record: //FUNÇÃO PARA LISTAR TODOS OS USUAROS public function ListarUsuarios() { $stmt = $this->conn->prepare ("SELECT *FROM N00_Usuario");…
-
1
votes1
answer257
viewsPDO 'Call to a Member Function prepare() on array'
Guys, I’m new to PDO and I’m watching some video lessons and also taking a look at the theoretical part, but when trying to accomplish a insert in DB, is returning me the following error Fatal…
-
1
votes0
answers197
viewsPHP 7 (Debian) connection error with Sybase 16
I have the following difficulty: I need to configure the PHP environment to connect to a Sybase 16 base. I am not a PHP programmer and I am helping another colleague. Everything that has been tried…
-
1
votes1
answer584
viewsHow to make an INNER JOIN with two tables in different Banks?
I have two different banks that I make the connection as follows: date_default_timezone_set('America/Sao_Paulo'); abstract class BancoDados { const host = 'localhost'; const novoweb = 'novoweb';…
-
1
votes1
answer395
viewsProduct Registration with Select Multiple does not insert all selected
The registered items have various flavors, chocolate, strawberry, vanilla, etc, and each is inserted by select multiple in the register, it is saved as "chocolate" but the other selected flavors are…
-
1
votes1
answer628
viewsFatal error Uncaught Pdoexception: General error: mode must be an integer
I am getting this error when I try to make an insert in the bank with PDO: > > <br /> <b>Fatal error</b>: Uncaught PDOException: SQLSTATE[HY000]: General error: mode must be…
-
1
votes2
answers367
viewsMysqli vs PDO - query/function execution
Looking at questions here from the stack and the php.net website, I saw that query/function executions in Mysqli use if() to check whether it was executed or not, and the PDO uses try { ... }…
-
1
votes1
answer701
viewsProblem with Docker Pdo installation
I’m having a problem with my containers in Docker, I was trying to raise a Lamp with Docker Compose, with the default image of php:apache and mysql, but when I install PDO this error appears.…
-
1
votes1
answer47
views -
1
votes2
answers351
viewsRequest via GET
I am trying to create a search system using a Request to get the search result. I am not able to bring the product data related to the title researched. Whatever the searched word, it always brings…
-
1
votes1
answer260
viewsHow to create a request via GET
This attribute below is working with href, and directing me to the desired page. <a href="prod_detalhe_5.php?codigo=<?php echo $res['codigo']; ?>"> <img src="img_produtos/<?php…
-
1
votes1
answer75
viewsTake value from right set with 'ambiguous' fields
I am making the following query to my database: $escalacoes = 'SELECT * FROM escalacoes AS e JOIN jogador_rodada AS jr ON e.id_jogador = jr.id_jogador WHERE e.rodada = ('.$rodada_atual.' - 0) AND…
-
1
votes1
answer53
viewsArray only loads last PHP record with PDO
I’m generating the information, but it only fills the last line of the query executed inside the Array, even though I’m sure it’s running all the lines in the foreach. Does anyone have any idea how…
-
1
votes0
answers72
views -
1
votes0
answers30
viewsStore query result in a PDO Session
I have a SELECT that generates results normally, but when I need to take the value of some column to use on another page it does not work. Query code and attempt to pass the result from a column to…
-
1
votes1
answer37
viewsHow to pass information in bindvalue with two or more information stored in the variable?
I’m having a problem... I’m getting some id from the database and storing in $ids_cozinha. gave a var_dump and a print_r, is returning me the id I want, so far so good. <pre> <?php…
-
1
votes0
answers27
viewsPDO - Join in a function
I am inserting a new query in a functional system, however I am not able to understand how to insert a JOIN , I saw that there is the Function, I just can’t implant. I tried to run like this…
-
1
votes0
answers434
viewsUpload files and images with PHP and Mysql
I’ve got a bug in my code only I don’t understand that is the code: <?php $db = new PDO("mysql:host=localhost;dbname=filedb;charset=utf8", "root", ""); $msg = false;…
-
1
votes0
answers96
viewsPDO Driver for Postgres Docker, does not install
I set up a PHP + Apache environment using Docker (so far everything OK), however, I noticed that PHP does not come with the PDO_PGSQL driver installed in the image.. I searched, found some solutions…
-
1
votes1
answer102
viewsPDO execute returns true but does not insert
I am trying to enter a record in the bank using this code: $sql = "INSERT INTO tb_ConteudoExtra (Titulo_ConteudoExtra, Texto, Id_TipoConteudoExtra, Data, Hora) VALUES ('".$nomePagina."',…
-
1
votes1
answer47
viewsPdo passsa return vaizio in JSON
I am trying to make a cash flow chart with input and output, however, when the JSON value is returning empty. follows below the code PHP $ano_hoje = date('Y'); $janeiro_entrada =…
-
1
votes0
answers61
viewsPDO works on localhost, but not on webservice
I made an app and it runs on localhost no problem at all. When I switched to hosting it simply does not read the SQL commands by PDO (it is enabled on php.ini). Connection seems to work fine,…
-
1
votes1
answer78
viewsAutomatic PDO and MYSQL listing
Good afternoon. I am trying to make the tables be automatically listed, without me having to name the field. But it’s showing errors. $conn = new PDO($dsn, $username, $password,…
-
1
votes1
answer160
viewsAssociate user data according to "/profile/username" url
Hello I’m a beginner in php and mysql, I’ve searched everything that is singing and I still can’t understand how to associate my user url to id. I would like to know how to associate and display…
-
1
votes0
answers29
viewsPHP cookies being terminated within the time limit
Hello, good night I would very much like someone to ask me a question about cookies in PHP when I set the cookie it usually goes to the browser’s cookie area with the correct date for which I set…
-
1
votes1
answer62
viewsProblem instantiating two models in a php controller
I made a mini framework, where the Models extends from a standard class that contains a crud, the only thing the models have is the table information to be used. But when I try to use two models in…
-
1
votes0
answers108
viewsPdo login authentication
I have a problem that always falls independently in the error line Incorrect Password, this script was in mysqli and I am trying to pass to PDO. What could be wrong? <?php session_start();…
-
1
votes2
answers101
viewsHow to use more than one LIKE in PDO bindValue
I’m having a hard time making an appointment SQL with the bindValue from PDO. I need to pass more than one value in the clause query like :cc plus the value returned is 0. If I use only one value…
-
1
votes2
answers415
viewsNo error message appears in php, but it does not work
I made a registration form and an Insert query with Pdo, but when entering the data and pressing the button to call the query nothing happens, no error messages appear, nor in the log, there is…
-
1
votes0
answers1886
views[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Good afternoon, you guys! I’m having a lot of headaches to connect my code to a file .dbf, and found no solution after running the internet for two days in a row... This is the code on PHP <?php…
-
1
votes1
answer93
viewsInsert does not work
I am trying to create a login log of my page, and store this information in the table stat however I am not succeeding and is not returning any error. I put an IF to signal if the inclusion was…
-
1
votes1
answer43
viewsExcluding by button
good morning guys, I’m using js with php, the problem I’m trying is that I’m not getting to understand how to move to the button and the script, follows below to where I left off. index php.…
-
1
votes0
answers32
views -
1
votes1
answer24
viewsError 1065 Query is Empty when changing page in my pagination
When I enter the first page loads the table normally but when I go to the second gives this error <?php header("Content-type: text/html; charset=utf-8"); error_reporting(E_ERROR | E_WARNING |…
-
1
votes0
answers798
viewsFatal error: Uncaught Error: Call to a Member Function prepare() on null
The site presents this error when connecting with BD. Someone can help me? Fatal error: Uncaught Error: Call to a Member Function prepare() on null in…
-
1
votes2
answers79
viewsMake two updates at once
I have a table with some records, I want to change two rows of this table at the same time I’m currently doing this: include("conexao.php"); $tabela1 = "endereco"; $endereco_id= "75";…
-
1
votes1
answer30
viewsError while listing table record using PHP PDO
Person, I’m trying to list the database table records, but I’m not getting, I’m getting the following error: Undefined index: name in... Undefined index: email in... With all the fields it’s…
-
1
votes0
answers64
views(PHP/PDO) Separate the Connection file from the Functions
Hello, I am doing a login-registration system with PDO, never used before and I am learning. My question is if you need to separate the file where I connect to the BD, from the functions like…
-
1
votes1
answer47
viewsHow to separate string in jquery from autocomplete?
I’m having problems to make a search system, at the moment I do the search/comparison with 2 columns and shows the name of the 2 columns. $pesquisa = filter_input(INPUT_GET, 'term',…
-
1
votes1
answer55
viewsHelp with PDO data in PHP!
Guys, I’m pulling data from a bank SQLSERVER with PDO for an HTML/PHP page, I used the following code: $query = "SELECT * FROM [BD].[Feriados]"; $stmt = $conn->query( $query ); while ( $row =…
-
1
votes1
answer29
viewsHow to make a select and a "Sub Select" faster (in PHP)
I am facing problems with query for counting records. I have a table of clients (separated by owners and family members). And I need to count the records by status, but the status of the family will…