Questions tagged as 'pdo'

1
answer

Conversion of SESSION MySQL to SESSION in PDO

How do I convert this SESSION below MySql to PDO. <?php if(count($_SESSION['carrinho']) == 0){ echo '<tr><td colspan="5">Não há produto no carrinho</td></tr>'; }else{ require("conexao.php");...
asked by 15.07.2018 / 15:08
1
answer

Fatal error Uncaught PDOException: General error: mode must be an integer

I'm getting this error when trying to do an insert in the database with PDO: > > <br /> <b>Fatal error</b>: Uncaught PDOException: SQLSTATE[HY000]: General error: mode must be an integer in > C:\Users\Usuário.NB-030...
asked by 18.01.2018 / 12:52
1
answer

Field 'data_log' does not have a default value - Does not enter data in the database

You are not entering user-only data in the database, so I used the command: print_r($inserir->errorInfo()); And this error appeared:    Array ([0] => HY000 [1] => 1364 [2] => Field 'data_log' does not have   a default value) In th...
asked by 16.10.2017 / 15:23
1
answer

How do I get the results of two tables by querying one with PDO?

I have the table establishment, table unit, and table professional. In the unit table, I have idestablishment. On the professional table, I have the idunity. I need to find all the data of the professionals by the id of the establishment. Anothe...
asked by 09.08.2017 / 22:11
1
answer

Number of fields - PDO [closed]

I've put some crud classes in PDO and almost all of them have 4 or 5 fields in the DB, they worked correctly. Now I am trying to create a crud of 6 fields, but it does not create the record in the DB at all, I rewrote the class again thinking...
asked by 21.09.2017 / 18:21
1
answer

How to select the name of a column in MySQL?

How to get the name of a column in MySQL even though it has no rows?     
asked by 11.07.2017 / 21:45
1
answer

Montart loop with variables to exclude with PDO

After a filter I have this form with the users and their services, what I am trying to do is send the information to delete the records with the parameters set in the form, in case it would be the User ID and the Service, enter the ones that are...
asked by 26.05.2017 / 14:07
1
answer

How to count rows of a table with PDO

I'm trying to get the number of rows from a Select to show some messages to the user or not, but all possible attempts did not return the correct result. What I'm using is a William Francisco Leite class that caters me perfectly, but I ca...
asked by 22.06.2017 / 15:36
1
answer

Which constant declare in PDO :: PARAM_ to insert date (yyyy-mm-dd h :: m: s) in mysql?

I need to pass a date to the database. I will use the class PDO, but I have the following doubt. At the time of creating the "bindValue ()" what kind of constant should I declare in PDO :: PARAM_?     
asked by 06.01.2017 / 01:47
1
answer

Login with PHP using PDO [duplicate]

I already know how to make registrations, however login is a bit complicated for me. I found some materials on the internet and I would like to know what the following line does. I know I'm collecting information from the form, I wanted to kno...
asked by 06.12.2016 / 14:34