Consulta SELECT MySQL

function consulta($cedula) { $con = new DBConexion; $listaCliente[] = array(); if($con->conectar()) { $query = "select * from cliente where cedula='$cedula' "; $result = @mysql_query($query); while($row = mysql_fetch_array($result)) { $cedula=$row['cedula']; $nombre=$row['nombre']; $primer_apellido=$row['primer_apellido']; $segundo_apellido=$row['segundo_apellido']; $correo=$row['correo']; $telefono=$row['telefono']; $listaCliente = array($nombre,$primer_apellido,$segundo_apellido,$telefono,$correo,$cedula); } if(!$listaCliente) { return false; } else { return $listaCliente; } } //USANDO la conexion de mi post anterior

1 Response

if(empty($listaCliente)){ return false;}else{ return $listaCliente;}

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.