Questions tagged as 'pdo'

2
answers

get lastInsertId with PDO

I'm trying to get the last record in the database and it responds with 0 (ZERO) .. lastInsertId(); . This is my connection to the BD: class conexion{ public static function conectar(){ try { $link = new PD...
asked by 19.10.2018 / 03:40
1
answer

Capture result returned from mysql using PDO by assigning variable INT

I need to be able to recover a record from the DB and store it in a variable as a whole value using PDO, I can not find the key and I will get the following error: /*llamo a la función*/ $vNumTicket = ($accessDB->obtenerValor()); /*Entro e...
asked by 27.09.2018 / 14:16
2
answers

How to avoid blank records to the db, in the filters the empty field is valid .. but still commands them

<?php $errores = ''; $enviado = ''; if (isset($_POST['submit'])) { $nombre = strtoupper($_POST['nombre']); $apellidopaterno = strtoupper($_POST['apellidopaterno']); $apellidomaterno = strtoupper($_POST['apellidomaterno']);...
asked by 26.08.2018 / 14:11
1
answer

Query all of a user's sales with totals

I am developing with PHP-PDO with MySQL and I have three tables: User (Seller) Sale Detail Sale How can I make a query in MySQL that shows me per user the detail of all the sales made (product, quantity, price, subtotal, *) plus the...
asked by 09.06.2018 / 01:37
1
answer

Problem when extracting data

I have Menu (food) within those menus I have submenus (first, second, etc) and within submenus I have dishes. The submenus I generate them perfect and as soon as the dishes always fill them with the last dishes of the last submenu id with whi...
asked by 16.05.2018 / 13:54
1
answer

Run Insert to table within loop with PDO

I send the year to my class and I want to insert records in the form AAAAMM ( integer ) The MM is of the form 01, 02 .... 11, 12. But it does not execute the class. Show error in the Insert . public function InsertarMesesAnio($anio){ for...
asked by 21.07.2018 / 06:33
1
answer

Error using PDO [closed]

The error is as follows:    Call to undefined method PDOStatement :: fecth () in /home/ubuntu/workspace/redsocial/classes/gestores/ManagerSeguidor.php on line 73 Call Stack: 0.0004 236840 1. {main} () / home / ubuntu / workspace / redsocial /...
asked by 06.05.2018 / 11:48
1
answer

Validation login with PHP / Postgresql PDO

I am working with a login form in html / PDO PHP. As my PDO knowledge is almost zero I have been advancing in what the logic indicates and with stackoverflow. I already made my connection and data capture and validated the information (I repeat...
asked by 04.05.2018 / 17:12
2
answers

Error Notice: Array to string conversion in PHP PDO

Could someone help me and say why he sends me that message? Attach the code: <?php try{ $conexion = new PDO('mysql:host=localhost;dbname=organizer', 'root', ''); } catch(PDOexception $e){ echo 'Error ' . $e->getMessage(); }...
asked by 06.04.2018 / 00:00
1
answer

PDO and Oracle query problem

I have a problem when making the query, it does not return anything. The query is correct since I have executed it in the sqldeveloper and it does not give me an error in the connection either. This is my code: test.php <!DOCTYPE html>...
asked by 07.04.2018 / 15:40