Questions tagged as 'pdo'

1
answer

Too slow table using Datatable

I am bringing 3,000 MYSQL database records using a connection to PDO and PHP. The time to be taken costs around 40 seconds until all the data is presented. Is Datatable unable to bring data in pieces? Below is my entire code: -HTML-...
asked by 01.06.2018 / 14:46
1
answer

Write user data in session after login

In the login screen I ask to release the access to the system, after that I would like to make a complete query of that user's data and save it in the SESSION. <?php // inclui o arquivo de inicialização require 'init.php';...
asked by 15.12.2017 / 21:22
1
answer

compare dates within the sql query

I need to compare the date entered in the bank +10 days with the current date and display the student that the current date is greater than the 10 days, but this within the sql query. Is there any function for this? I tried this, without success...
asked by 14.11.2018 / 14:29
1
answer

Warning: array_keys () expects parameter 1 to be array, null given in [closed]

How do I resolve this?    Warning : array_keys () expects parameter 1 to be array, null given in C: \ Program Files \ VertrigoServ \ www \ store \ classes \ Site.class.php on   line 81       Warning : array_values () expects parameter 1 to...
asked by 26.10.2017 / 19:57
1
answer

Why does not return any results in PDO fetch collum?

I made a query and I want to use fetch collum according to a response from the other site; $query = $pdo->prepare("SELECT b.**, b.**, b.**, b.**, b.**, b.**, b.**, b.**, b.**, b.**, b.token FROM tbl_contas AS b"); $query->execute();...
asked by 08.06.2017 / 17:07
1
answer

How to list multiple columns using Inner Join and left join? [duplicate]

How can I get data from two tables? Example. thefields'assunto,nomeremetente,cpfremetente,observacao'databela**protocolos**anddatacriacaoofthedocument_documenttableisofdocument_documentisdataformat(datacriacao,'%d/%m/%Y')asdatacriacaot...
asked by 10.10.2016 / 19:51
1
answer

Problem with MySQL and PHP query

I have the following problem, when I use the WHERE clause I am not able to use the values being passed by parameter. As a return I get the following message: PDOStatement :: execute (): SQLSTATE [HY093]: Invalid parameter number: number...
asked by 13.06.2016 / 18:58
1
answer

a more efficient way to bind large insert and update

public function update($table, $data, $where,$criterios) { $set = ""; foreach ($data as $keyname => $value) { $set .= ($set == "") ? "" : ", "; $set .= $keyname . " = " . ":".$keyname ; } $sql = "UPDATE $tabl...
asked by 12.05.2016 / 02:08
2
answers

mysql with unique result in PDO

I'm trying to create a query as follows: I have a table in the database with this structure:    name | address | status The status field only has 2 types of values 1 or 0. I want to count all records that have status 0 I made the fo...
asked by 06.03.2017 / 20:32
1
answer

Difficulty with PDO

I'm starting with the use of PDO and I have a question I could not solve. I do the select below that will return me 2 times: $sqlSaida = 'SELECT horario FROM HORARIOS WHERE COD = :codsaida UNION...
asked by 04.12.2015 / 19:02