Questions tagged as 'pdo'

2
answers

Mysql query that shows matches and then the rest of the rows

I have a MySql database in which I keep activities with the following structure. id (int) | nombre(varchar) | descripcion(text) | mes(tinyint) What I'm trying to get is to show in php a list of them from the current month. Until...
asked by 05.06.2017 / 01:49
1
answer

Help with PDO and POO in PHP, I get 500 error

I can not make PDO work in a P APIP API that I am creating and I do not understand the reason Here I leave a bit of my code The route I enter is http://localhost/public/api/order , which executes the following code, which executes th...
asked by 30.07.2018 / 02:28
3
answers

2 actions for the same sentence a

Does anyone know how to place this code correctly? I'm following one of the forum that I found but it always tells me: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens <a href="index2...
asked by 04.04.2017 / 17:33
1
answer

How can I update data from a multiple input select

I have a problem (I do not know how to do an UPDATE) when it comes to updating the student's file since it only changes the name and image of the student, and what I want to do is add or remove the courses in which it is enrolled from a multiple...
asked by 18.03.2017 / 23:36
3
answers

Problem with fetch (PDO :: FETCH_ASSOC)

I have a small login form, with the variables $ user and $ password that have the correct values, the problem is that it gives me    Fatal error: Call to a member function rowCount () on boolean that is, as if the array were empty and I h...
asked by 06.11.2016 / 18:31
3
answers

Basic PDO query

I'm starting with PDO and I have a problem I'm following a course which I'm copying everything at the bottom of the letter but it does not return data when doing a print_r I returned a 1, and in the database I have 3 users already...
asked by 11.07.2018 / 07:55
2
answers

How to add decimals of a Mysql record with php?

I have a small drawback about adding up the total of a field in the database that is of type DOUBLE (6,3) . I have dealt with number_format and money_format. An example is when I'm going to register the field, I put 240 and when I sav...
asked by 26.08.2017 / 02:39
1
answer

Select data from a table related to a user

I have these two tables: users: +-----+----------+------------+ | id | nombre | apellidos | +-----+----------+------------+ | 1 | juan | apellido1 | | 2 | pepito | apeliido2 | +-----+----------+------------+ subjects: +----+--...
asked by 03.06.2017 / 19:02
1
answer

How does this sentence prepared in PDO in PHP work?

I am reading about PDO and prepared sentences, I got this way of selecting data from the database, I would like someone to explain to me because I do not understand all the functions very well, especially the declared class and the recursiveIter...
asked by 25.05.2017 / 01:26
2
answers

Consequences for not using semicolons at the end of mysql queries in PDO?

I had some data mixes in my mysql table and I'm thinking if that would be due to lack of some semicolons at the end of my queries. Let's say I have this code: $sql = "DELETE FROM customers_2016 WHERE customer_db_id = ? "; $stmt = $pdo->...
asked by 29.03.2017 / 16:28