Finally been able to make it work.
First got the form with the needed classes for the input fields, as been told by the Form-Validatio-Engine script instructions. Here's and input field:
<input type="text" name="user_login" class="validate[required,length[5,15],ajax[ajaxUser]]" value="Username"/>
The length[5,15] helps narrow the searches.
To access the database used this dbConnector.php:
<?php
class DbConnector {
var $theQuery;
var $link;
function DbConnector(){
// Get the main settings from the array we just loaded
$host = 'HOST';
$db = 'DATABASE';
$user = 'root';
$pass = 'root';
// Connect to the database
$this->link = mysql_connect($host, $user, $pass);
mysql_select_db($db);
register_shutdown_function(array(&$this, 'close'));
}
//*** Function: query, Purpose: Execute a database query ***
function query($query) {
$this->theQuery = $query;
return mysql_query($query, $this->link);
}
//*** Function: fetchArray, Purpose: Get array of query results ***
function fetchArray($result) {
return mysql_fetch_array($result);
}
//*** Function: close, Purpose: Close the connection ***
function close() {
mysql_close($this->link);
}
}
?>
Then created a file validateUser.php to take the values from the database and compare them with the information typed at the input field.
<?php
/* RECEIVE VALUE */
$validateValue=$_POST['validateValue'];
$validateId=$_POST['validateId'];
$validateError=$_POST['validateError'];
/* RETURN VALUE */
$arrayToJs = array();
$arrayToJs[0] = $validateId;
$arrayToJs[1] = $validateError;
include("dbConnector.php");
$connector = new DbConnector();
$query = "SELECT user_login FROM wp_users WHERE user_login = '$validateValue' LIMIT 1";
$result = $connector->query($query);
$num = mysql_num_rows($result);
if($num == 0){ // validate??
$arrayToJs[2] = "true"; // RETURN TRUE
echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}'; // RETURN ARRAY WITH success
}else{
for($x=0;$x<1000000;$x++){
if($x == 990000){
$arrayToJs[2] = "false";
echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}'; // RETURN ARRAY WITH ERROR
}
}
}
mysql_close();