Questions tagged as 'pdo'

1
answer

Error Notice: Undefined offset: 0 when getting PHP PDO data

By using the following function I get that error, the function is used to verify whether or not there is a string in DB , if it does not remove that error, but if it does not exist I get the error    "Notice: Undefined offset: 0" I...
asked by 01.03.2018 / 21:56
1
answer

debugging of SQL queries in PHP (var_dump and debugDumpParams)

When we are writing our SQL queries, we may need to check how the dynamic data we are sending is behaving, to validate that the result is expected. EXAMPLE I have the following script to bring all the posts of a certain user working 2 ta...
asked by 03.10.2018 / 03:40
2
answers

Error showing list with PDO

Hello I'm trying to show a list which showed me with 'myslqi' now I'm working with PDO but I can not make it work the error that generates me I do not understand it. function listadoUsuarios(){ $db = new BaseDatos(); $db->conectar()...
asked by 14.03.2018 / 11:54
1
answer

Multiplication and sum in MySql or php

I need to perform the following operation of the following table in mysql or php: I need to calculate unit_value by quantity (unit_value * amount) and add all the values when the nonreceiver is equal to 11 (where no_recibo = 11). I n...
asked by 06.09.2017 / 04:50
1
answer

ORA-01008: not all variables bound

I'm doing a query to a database using php, the case is that it gives me    error ORA-01008: not all variables bound And I do not know how to solve it. If you can help me, I appreciate it. The function that I am executing is: function co...
asked by 21.08.2017 / 20:09
2
answers

Problem when running consecutive MySQL queries in PHP

I want to insert records in a table from another table. The first record to insert is the record that has the sum of the amounts of the records in the source table. (Position) And the rest of the records to insert are those that appear in the so...
asked by 13.10.2017 / 00:58
1
answer

Pass Array to Int - PHP

I need to obtain the id of the student with his rout (identification number) which I achieve in the query that I do in PDO the problem in which an array returns and not an int. Then I was in doubt transform the value obtained in an integer or...
asked by 07.08.2017 / 19:09
1
answer

Incorrect Data to Get COUNT value of a query with rowCount PDO - PHP

I'm doing a query on the model of a web application in PHP with MVC . The idea is to make a query in which to put the value in empresa_id I see the total rows with that company, for this I used COUNT() in the query...
asked by 06.04.2018 / 18:23
1
answer

Login with password_verify

I applied encryption passwords using password_hash() . When I try to login using password_verify I can not access. I think the problem is in the $row = $query->fetch(PDO::FETCH_ASSOC) part because when I do var_damp(...
asked by 01.06.2017 / 12:17
2
answers

illegal string offset PHP

If you know how I could resolve this, I would appreciate it very much: PROBLEM:    illegal string offset 'index (can be "id" or another cualqiera)' This is coming to me when I try to get information from the database that stores my i...
asked by 18.08.2018 / 19:33