Welcome Guest, Not a member yet? Register   Sign In
Code Igniter and Jquery Validation Plugin
#7

[eluser]Pascal Kriete[/eluser]
[quote author="Xtrex" date="1217027058"]
Code:
function atribuido($tabela,$atributo,$campo)
    {
        $query = $this->db->query('SELECT * FROM '.$tabela.' WHERE '.$atributo.' = "'.$campo.'"');
        if ($query->num_rows() > 0){
            echo true;
        } else {
            echo false;
        }    
}
[/quote]

The ajax request gets the string output, not the value. Echoing false doesn't return anything, and echoing true just returns 1. Try echoing the string instead.

Since this request doesn't need anything else, you can make debugging easier by killing the script to avoid any unexpected output.
Code:
if ($query->num_rows() > 0)
{
    exit('true');
}
else
{
    exit('false');
}


Messages In This Thread
Code Igniter and Jquery Validation Plugin - by El Forum - 07-25-2008, 12:04 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-25-2008, 09:59 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-25-2008, 10:08 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-25-2008, 10:21 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-26-2008, 06:16 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-26-2008, 07:00 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-26-2008, 08:52 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-26-2008, 09:08 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-26-2008, 09:12 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-26-2008, 10:50 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-27-2008, 05:59 AM
Code Igniter and Jquery Validation Plugin - by El Forum - 10-27-2008, 10:51 PM
Code Igniter and Jquery Validation Plugin - by El Forum - 07-06-2011, 07:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB