Ok ahora te dejo un codigo bastante sencillo sobre esto
Código PHP:
Ver original<?php
if(isset($_POST['lol'])){ //Recuerda hacer una funcion para limpiar lo que ingresen al textbox o pueden hacer una sql injeccion
$text = $_POST['usuario'];
$q = mysql_query("SELECT * FROM TABLA WHERE CAMPO='$text'"); echo "El Usuario esta en uso";
}
//Codigo de insercion
}else{
?>
<form name="form1" method="post">
<input type="text" name="usuario">
<input type="submit" name="lol" value="Enviar">
</form>
<? } ?>