Questions tagged as 'pdo'

1
answer

pdo :: __ construct (): php_network_getaddresses: getaddrinfo failed: name or service not known in

I am uploading my website to the server and when logging in I vote this error. I have a connection page in which I detail all the configuration define('URL', 'https://www.aynii.pe/'); define('APLICATION', 'aplication/'); define('DB_TYPE', 'mys...
asked by 18.08.2018 / 01:36
1
answer

How to show different messages when entering duplicate data to the database? Php / MySql

Hello! I am trying that, when the user enters the name of a region, if the same one is repeated it will be shown in the screen "An error occurred", but I can not. Region.php: class Region { private $regID; private $regNombre;...
asked by 24.03.2018 / 20:02
1
answer

Database query php and mysql PDO

Someone who can help me ..... I want to print the userid, as I already have in the html, it's just an echo "$ result" .... <?php session_start(); include "conexion.php"; $user = $_SESSION['usuario']; $idusuario="SELECT id_usuario FROM u...
asked by 05.12.2017 / 05:47
2
answers

show queries by careers

the idea is to show the consultations by career in the following image: the first 4 records on the right are of the second race and the last 4 of the first race and it is wrong, for example the query on the left shows me that it is the Second...
asked by 24.01.2018 / 21:59
1
answer

how to create select dependents pdo

hello friends I am currently trying to make a select dependent, but I can not get it to show me the other select, if I inspect the item it shows me the selected value. My tables are the following: table: employees    id_employees, names,...
asked by 14.06.2017 / 05:15
1
answer

problems to validate with preg_match and filter_var

I have a problem trying to validate input with preg_match and filter_var it does not validate me. I append the code to see what I'm failing. <?php include_once "conexion/conexion.php"; if(isset($_POST['guardar'])){ $nombresyapellidos...
asked by 01.06.2017 / 05:57
1
answer

Problems with connection to ORACLE with PDO and PHP

A moment ago post the following question! Problems with PDO and PHP Once the code in the connection file has been corrected, the following error appears!    could not find driver       Fatal error: Uncaught Error: Call to a member funct...
asked by 27.04.2017 / 20:28
3
answers

How do I prevent a "patient" from registering twice? PHP MySQL

I am creating a small "site" for a medical friend, who needs to keep track of patients, he needs to enter the data for each client as Full Name and Address, but I want to register a new patient, check if he is already is registered, taking into...
asked by 27.02.2017 / 06:04
2
answers

Is there an equivalent to lastInsertId () for an UPDATE?

I am using PHP and MySQL with PDO; I would like if there is an equivalent to the lastInsertId () method that returns the last ID of a row that has been inserted, but that returns the last ID of a row that was updated.     
asked by 25.05.2016 / 23:33
3
answers

Query ready MySQLi

Good people I want to ask a question about How to translate this code in PDO to MySQLi ? I'm having problems how to take it to MySQLi any ideas. Greetings. $stmt = $conn->prepare("SELECT * FROM usuario WHERE rut = :codigo"); $s...
asked by 30.10.2018 / 15:18