Questions tagged as 'pdo'

1
answer

Save values of a query in php

I need this occasion, know how to save the values of c.cat_name , sc.idSub and i.numFile , of the query, to use them later. $query1 = 'SELECT c.cat_name,sc.idSub,i.numFile from inventory_list as i inner joi...
asked by 21.11.2018 / 19:10
1
answer

Find a table with the name inside another

Sorry for my inexperience but I do not have a concrete idea of how to do the following. In a database table (project_snippets) in a table (code) I have four columns: id, code, author & link and id is the primary key. in the column code I wan...
asked by 10.11.2018 / 20:06
1
answer

levels of user login

I have created a code that differentiates user levels, specifically 2, client and administrator when logging using PDO. The thing is that I initially put this code on the client page cliente.php <BODY> <!-- NIVEL USUAR...
asked by 08.08.2018 / 18:22
1
answer

Perform an update of an array using pdo

I want to update this table with this array : $datos[] = array('id_comprobantes' => $value['id_comprobantes'], 'estado' => "GENERADO"); With this he sent it to the model: $actu = $this->model->actualizar_e...
asked by 17.07.2018 / 16:51
1
answer

Problem with: "Only variables should be passed by reference in"

I'm starting to learn to program in PHP, and right now I'm doing a simple web. As it says in the title, I have the error of: "Only variables should be passed by reference in". Which is not an error since the code does what I want it to do (which...
asked by 23.06.2018 / 01:57
2
answers

Validate if there is an id in the database, if there is an update and if there is no insertion to do it - PHP and postgresql

Good afternoon as you can see in the title, I want that at the time of entering the data to the bd of postgresql first verify that the "doc" exists, if there is an update and if there is no do an insert into , I tried and reading in forums examp...
asked by 28.05.2018 / 19:28
1
answer

Function in PDO to escape special characters

What is the function that is currently being used in PDO to escape special characters before executing a SQL statement? Before starting to use PDO I was using real_escape_string (), in addition to others that are used to clean strings such as...
asked by 04.03.2018 / 00:12
1
answer

Insert data from an array to mysql with php

I have two tables related to the principal and the detail. I have to register for example: Tabla 1 Idpersona persona 01 Juan Tabla 2 ID idpersona pedido 1 01 zcahs 2 01 bitcoin 3 01 Eterium To insert...
asked by 25.02.2018 / 14:33
3
answers

Error: SQLSTATE [28000] [1045] Access denied for user 'digital_chuser' @ 'localhost' (using password: YES)

I have the following problem, I am trying to connect to the database with pdo in HostGator but I receive the following error:    Error: SQLSTATE [28000] [1045] Access denied for user   'digital_chuser' @ 'localhost' (using password: YES)...
asked by 08.03.2018 / 18:41
1
answer

Login with Value Objects without using all the fields in the table

I'm doing a login and in VO I use setter and getters . In the DAO when doing the query I only invoke three fields, but when trying to record it in the object UsuarioVO shows me    Fatal error: Uncaught...
asked by 06.02.2018 / 04:24