Questions tagged as 'pdo'

1
answer

Does not validate conditional with array in php

I have a form that adds the total amount of all the installments. I put a conditional where it tells me if the array has data print me the total otherwise I print a message. I do not know what my error is, but it does not print the message. I...
asked by 06.07.2017 / 17:56
1
answer

PHP-mysql error (PDO) [closed]

I have a question, I have this class: <?php class DB{ //Función para conectar con la base de datos public static function ejecutaConsulta($sql) { $servidor = "localhost"; $dbname = "vehiculos"; $usuario = "root"; $contrasena...
asked by 02.06.2017 / 17:36
1
answer

How to go through PDO query in PHP

I have an application where I need to obtain the values of a query made: I tried this way and if it worked (with mysqli): //para conectarse a la Base de Datos $host = '127.0.0.1'; $user = 'root'; $pass = ''; $db = 'incidencias'; $cone...
asked by 08.05.2017 / 05:05
1
answer

PDO error: Uncaught PDOException: SQLSTATE [HY093]: Invalid parameter

This is my code: $errors = array(); $data = array(); if ((empty($_POST['nombre']))||(ctype_space($_POST['nombre']))) $errors['nombre'] = 'Nombre (s)'; if ((empty($_POST['apellidoP']))||(ctype_space($_POST['apellidoP']))) $errors['ape...
asked by 28.04.2017 / 22:08
1
answer

Because my login is not redirecting me!

When I log in, it redirects to the page where the driver file is what is this    link THIS IS THE MODEL FILE: <?php class conexion{ private $conexion; private $host = "localhost"; private $usu = "root"; private $pass = ""; pri...
asked by 01.04.2017 / 06:37
2
answers

Informix PDO and XAMPP

Greetings to all and in advance thanks to any answer and / or help you may receive. I have problems connecting PHP 5.6.24 of XAMPP to an INFORMIX server that is not on my local machine. Install the Informix CSDK, I made the respective conf...
asked by 03.02.2017 / 14:06
2
answers

Difference between loop while and foreach

I have two codes to list a query, the connection is with PDO. $BD = new ConexionDB(); $sql = "SELECT cod, nom from tabla"; $sth = $BD->prepare($sql); $sth->execute(); $valor = 0; foreach($sth as $fila) { $valor++; echo $valor."...
asked by 11.01.2017 / 18:31
1
answer

PDO num_rows count

I have this select input that gives me the option to choose a name of all the ones that can be removed: <td width="50%"> <select class="form-control" id="acro_proyecto" name="acro_proyecto" required> <option value="<...
asked by 01.06.2017 / 09:06
4
answers

Do what I do in MySQL but in PDO with PHP

I'm trying to learn PDO , I'm handling PHP, but with mysql_query I wanted to migrate to PDO , but it gives an error, I tried inserting but it does not work now, I want to try doing a query but I do not know someone would know why he will n...
asked by 21.03.2017 / 22:59
2
answers

How do I get a Select with PDO in Php correctly

I'm trying to get a select from a database. Index Code <?php @$mostrar=$_POST["mostrar"]; if($mostrar){ $form=1; $mMatricula=$_POST[...
asked by 24.11.2018 / 07:10