session_start(); include("conexao.php"); if ( isset($_GET["apagar"]) ) { $id = $_GET["apagar"]; if ( $id != '' ) { $consulta = "Delete from usuarios where id = " . $id; $resultado = mysql_query($consulta) or die (mysql_error()); echo ""; } } $consulta = "Select * from usuarios"; if (isset($_GET['oper'])) { $oper = $_GET["oper"]; if ($oper == "1") { $codservico = $_POST["codservico"]; $consulta = $consulta . " where codservico Like '$codservico'"; } else if ($oper == "2") { $status = $_POST["status"]; $consulta = $consulta . " where status = ". $status; } } $consulta .= " order by id desc "; $resultado = mysql_query($consulta) or die (mysql_error()); ?>