Questions tagged as 'pdo'

0
answers

Show View result in PHP

Good evening, I need to show the result of a view I created in Postgres, but I do not get any feedback. View on Postrgres: CREATE VIEW VW_RELATORIO03 AS SELECT EXTRACT (MONTH FROM DATSOLPED) AS MES, COUNT(*) AS CONTADOR, SUM(VALPED)...
asked by 14.11.2017 / 00:00
0
answers

how 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"); $stmt->execute();...
asked by 16.11.2017 / 21:07
1
answer

HELP - I can not identify error - PHP and SQL

Hello,  I am trying to bring in a table the grouping of all steps and item evaluation per year along with the average of the scores and weights. I can only bring the last step and item p table, that is, it is not doing the grouping, although...
asked by 08.11.2017 / 15:03
1
answer

PDO 'Call to a member function prepare () on array'

I'm new to the PDO and I'm seeing some video lessons and also taking a look at the theoretical part, but when I try to make a insert in DB, I'm returning the following error Fatal error: Call to a member function prepare() on array in...
asked by 18.11.2017 / 19:08
2
answers

PDO - Which is better: columnCount or rowCount? [closed]

I'm new to PDO (I was forced to choose between mysqli and pdo after migrating php from version 5.2 to 7.0) and I made a system where the user searches: $b2 = $_POST['b2']; $busca = $PDO->query("SELECT * FROM noticias WHERE titulo LIKE '%$b2...
asked by 20.11.2017 / 01:11
1
answer

BETWEEN with inner join does not work

I'm having a problem while doing a query using between with inner join, the query simply is not working, it returns the results as if the in between was not in the query. What am I doing wrong? SELECT * FROM usuarios INNER JOIN matriculas ON (...
asked by 04.10.2017 / 22:50
0
answers

PDO returning error when there is no error

Randomly, I get the following error while updating my system: Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Cannot assign requested address By mistake, it can not connect to the server, but the server is there, and it's on, of...
asked by 21.09.2017 / 14:39
0
answers

SQlite PHP injection

Hello everyone! I am currently using sqlite in a personal project and am using this class: link When I use the query function of it, I'm inferable from SQLinjection, for example in this example: $login=$database ->get_row('SELECT * fro...
asked by 25.08.2017 / 03:17
0
answers

how can I create and model a table with attributes in the database with the PDO using array?

I have already got this method following some examples that I saw there but I still do not understand very well how I'm going to go through this array and make the table attributes public static function Colluns($database,$tables) { #'id_pes...
asked by 18.08.2017 / 18:14
0
answers

update does not work pdo php

I'm doing 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 = $_POST['id']; $resultado = ""; $nomeMD5 = md5($nome); //p...
asked by 09.09.2017 / 14:28