Questions tagged as 'pdo'

1
answer

It is unusual to have a class called mysqli the getInstance () method returns the Fatal error: Uncaught Error: Call to undefined [closed]

Hello, I'm doing a system to fetch the data in the database for the month only it gives the following error    Fatal error: Uncaught Error: Call to undefined method   mysqli :: getInstance () It's all right in my eyes. This is a query....
asked by 04.01.2017 / 21:16
1
answer

PDO SQLSTATE [07002]: COUNT field incorrect or syntax error [duplicate]

I'm having trouble making a decrease in sql with pdo. I'm getting the following error   SQLSTATE [07002]: [Microsoft] [ODBC Driver 11 for SQL Server] COUNT field incorrect or syntax error code <?php ob_start(); include'../../classe...
asked by 30.10.2016 / 21:58
1
answer

BETWEEN with field type DATETIME

Using BETWEEN with DATETIME database fields it does not return any records with date equal to datei and dataf. Using DATE_FORMAT to search by date by ignoring TIME Considering the search $ dtai = '01 / 06/2016 'and $ dtaf = '06 / 05/2016', re...
asked by 06.05.2016 / 23:52
1
answer

Error in function of UPDATE in PHP with PDO

This code can not find the records, and causes the variable $lista to be undefined. My HTML: <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php i...
asked by 10.12.2015 / 18:00
2
answers

How to query data from a table using INNER JOIN in a subquery in PHP

I have the following SELECT to select data from a table ( chat ) on a chat system: SELECT * FROM (SELECT * FROM chat WHERE id_chat = '$chat_id' ORDER BY id DESC LIMIT 10) S WHERE id_chat = '$chat_id' ORDER BY id ASC LIMIT 10 Th...
asked by 12.01.2016 / 00:49
2
answers

Could not find driver (PDOException "could not find driver")

I'm trying to make a connection to my FIREBIRD database, but when I organize it correctly, I put the IP where it's located, etc. The message appears:    IT WAS NOT POSSIBLE TO LOCATE THE DRIVER IN c / wamp / www //// What should I do pers...
asked by 01.07.2015 / 17:03
1
answer

Correctly insert data into table

I'm having serious problems with INSERT of PDO , I can not add values correctly to banco de dados , how do I do this? Problem Image: Ilookforwardtohelpingyou.<?phpif(isset($_POST['btn-send-ticket'])){$name=filter_input(...
asked by 28.01.2016 / 22:19
1
answer

How do I make a query to return the value of another table? [duplicate]

Table PRODUTOS id productname product category valordoproduto Table CATEGORIAS id classname In my form I show the name of the category but register in the database in the table PRODUTOS the id of the...
asked by 19.11.2014 / 23:49
1
answer

PHP MVC Object Orientation

I have 4 tables in the database: Admin - Teacher - Class - Student and my question is: I would have to create: AdminModel.class.php ProfessorModel.class.php TurmaModel.class.php StudentModel.class.php AdminView.class.php Professo...
asked by 08.09.2015 / 04:27
2
answers

Json does not return data from the Mysql database

I have a table in the Mysql database that contains 3 fields (id, name and model) different from the other fields, the data email template with tags HTML (structure in longtext ). When I run the PHP code to return the data to me, it d...
asked by 01.07.2018 / 20:13