Search
 
SCRIPT & CODE EXAMPLE
 

SQL

PDOException: SQLSTATE[HY093]: Invalid parameter numb

$stm->execute(
    array(":user_id" => $user_id, 
          ":hash" => $hash, 
          ":expire" => $future,
          ":hash2" => $hash)
);
Comment

SQLSTATE[HY093]: invalid parameter number:

open();
	try{
		$s = $db->prepare($sql);
		//hacer uso de una declaración preparada para prevenir la inyección de sql
		$stmt = $db->prepare("INSERT INTO empleados (idEmp, cedula, genero, Nombres, Apellidos, sitenac, edad, yearnac, municipio, estado, direccion, tvivienda, condicionv, tlfhab, tlfpersonal, email, habilidades, alergico, peso, estatura, camisa, pantalon, zapatos, lateridad, canaima, operativa, ccodigo, pprocedimiento, beca, designado, colegioproviene, hermano, hermanoname, hermanomencion, observaciones, representanteci, repgenero, repname, parentesco, reptlf, reptlfcasa, represitenac, repdirecion, repocupacion, reptlftrab, reptlffamily, reptlfvecino, repdirjob, repcta, repbco, repctatipo, repemail, repcardserial, repcardcode) VALUES (:idEmp, :cedula, :genero,:Nombres,:Apellidos, :sitenac, :edad, :yearnac, :municipio, :estado, :direccion, :tvivienda, :condicionv, :tlfhab, :tlfpersonal, :email, :habilidades, :alergico, :peso, :estatura, :camisa, :pantalon, :zapatos, :lateridad, :canaima, :operativa, :ccodigo, :pprocedimiento, :beca, :designado, :colegioproviene, :hermano, :hermanoname, :hermanomencion, :observaciones, :representanteci, :repgenero, :repname, :parentesco, :reptlf, :reptlfcasa, :represitenac, :repdirecion, :repocupacion, :reptlftrab, :reptlffamily, :reptlfvecino, :repdirjob, :repcta, :repbco, :repctatipo, :repemail, :repcardserial, :repcardcode)");
		//instrucción if-else en la ejecución de nuestra declaración preparada                                                          
		$_SESSION['message'] = ( $stmt->execute(array(':cedula' => $_POST['cedula'] , ':genero' => $_POST['genero'] , ':Nombres' => $_POST['Nombres'], ':Apellidos' => $_POST['Apellidos'], ':sitenac' => $_POST['sitenac'], ':edad' => $_POST['edad'] , ':yearnac' => $_POST['yearnac'] , ':municipio' => $_POST['municipio'], ':estado' => $_POST['estado'], ':direccion' => $_POST['direccion'], ':tvivienda' => $_POST['tvivienda'] , ':condicionv' => $_POST['condicionv'] , ':tlfhab' => $_POST['tlfhab'], ':tlfpersonal' => $_POST['tlfpersonal'], ':email' => $_POST['email'], ':habilidades' => $_POST['habilidades'] , ':alergico' => $_POST['alergico'] , ':peso' => $_POST['peso'], ':estatura' => $_POST['estatura'], ':camisa' => $_POST['camisa'],':pantalon' => $_POST['pantalon'] , ':zapatos' => $_POST['zapatos'] , ':lateridad' => $_POST['lateridad'], ':canaima' => $_POST['canaima'], ':operativa' => $_POST['operativa'] , ':pprocedimiento' => $_POST['pprocedimiento'] , ':beca' => $_POST['beca'], ':designado' => $_POST['designado'], ':colegioproviene' => $_POST['colegioproviene'],':hermano' => $_POST['hermano'] , ':hermanoname' => $_POST['hermanoname'] , ':hermanomencion' => $_POST['hermanomencion'],':observaciones' => $_POST['observaciones'] , ':representanteci' => $_POST['representanteci'] , ':repgenero' => $_POST['repgenero'],':repname' => $_POST['repname'] , ':parentesco' => $_POST['parentesco'],':reptlf' => $_POST['reptlf'] , ':reptlfcasa' => $_POST['reptlfcasa'] , ':represitenac' => $_POST['represitenac'], ':repdirecion' => $_POST['repdirecion'] , ':repocupacion' => $_POST['repocupacion'] , ':reptlftrab' => $_POST['reptlftrab'],':reptlffamily' => $_POST['reptlffamily'] , ':reptlfvecino' => $_POST['reptlfvecino'],':repdirjob' => $_POST['repdirjob'] , ':repcta' => $_POST['repcta'] , ':repbco' => $_POST['repbco'],':repctatipo' => $_POST['repctatipo'] , ':repemail' => $_POST['repemail'] , ':repcardserial' => $_POST['repcardserial'], ':repcardcode' => $_POST['repcardcode'])) ) ? 'Empleado guardado correctamente' : 'Algo salió mal. No se puede agregar miembro';
		
	
	}
	catch(PDOException $e){
		$_SESSION['message'] = $e->getMessage();
	}

	//cerrar la conexion
	$database->close();
}

else{
	$_SESSION['message'] = 'Llene el formulario de inscripción';
}

header('location: index.php');
	
?>
Comment

PREVIOUS NEXT
Code Example
Sql :: sintaxis SELECT sql 
Sql :: vbscript clean up ADODB.Recordset 
Sql :: convert linq to sql query online 
Sql :: sort by 
Sql :: oracle synonym package dblink 
Sql :: difference between ltrim and rtrim in sql server 
Sql :: script to run SP_SPACESED on all tables in DB 
Sql :: TSQL Find csv file in folder 
Sql :: exel bulk insert 
Sql :: mysql add 24 hours to datetime 
Sql :: express api ith mysql data 
Sql :: get who is hired in specific month in sql 
Sql :: no customers ordered 
Sql :: mysql Puede ser solamente un campo automatico y este debe ser definido como una clave 
Sql :: How to calculate average of average salary of departments? 
Sql :: if new such record in where condition in sql so what is return 
Sql :: forenkey code alchemy sql 
Sql :: nuget sqllite-net-pcl 
Sql :: sql gather statistics to increase performance 
Sql :: how to import sqlite driver class in java using maven 
Sql :: get create sql of hibernqte entity 
Sql :: run all sql file from folder postgres command line 
Sql :: proc sql not in working 
Sql :: function sum(text) does not exist postgres 
Sql :: C# check if mysql query modified rows 
Sql :: mysql cannot access localhost 
Sql :: How should I pass a table name into a stored proc? 
Sql :: case when with count and combining similar values in sql 
Sql :: how many columns can be used for creating index? 
Sql :: Uncaught PDOException: SQLSTATE[HY000] [1698] 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =