Validation Callback function not working |
[eluser]pickupman[/eluser]
Try placing anywhere in the controller or callback Code: $this->output->enable_profiler(TRUE); This will show you all queries being run, and number of rows and such.
[eluser]terry101[/eluser]
ok i have tried what you suggested and this is what i got. Not sure what i'm looking for in this... maybe you might know. any idea where it went wrong? BENCHMARKS Loading Time: Base Classes 0.0170 Controller Execution Time ( User / Register ) 0.0500 Total Execution Time 0.0672 GET DATA No GET data exists MEMORY USAGE 4,520,560 bytes POST DATA $_POST['username'] johnny $_POST['name'] $_POST['email'] $_POST['password'] $_POST['password_conf'] $_POST['register'] Register URI STRING user/register CLASS/METHOD user/register DATABASE: blog QUERIES: 1 0.0016 SELECT * FROM (`tbregister`) WHERE `username` = 'johnny' HTTP HEADERS HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_USER_AGENT Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1 HTTP_CONNECTION keep-alive SERVER_PORT 80 SERVER_NAME localhost REMOTE_ADDR 127.0.0.1 SERVER_SOFTWARE Apache/2.2.17 (Win32) PHP/5.3.4 HTTP_ACCEPT_LANGUAGE en-US,en;q=0.8 SCRIPT_NAME /code/index.php REQUEST_METHOD POST HTTP_HOST REMOTE_HOST CONTENT_TYPE application/x-www-form-urlencoded SERVER_PROTOCOL HTTP/1.1 QUERY_STRING HTTP_ACCEPT_ENCODING gzip,deflate,sdch HTTP_X_FORWARDED_FOR CONFIG VARIABLES base_url http://localhost/code/ index_page index.php uri_protocol AUTO url_suffix language english charset UTF-8 enable_hooks subclass_prefix MY_ permitted_uri_chars a-z 0-9~%.:_\- allow_get_array 1 enable_query_strings controller_trigger c function_trigger m directory_trigger d log_threshold 0 log_path log_date_format Y-m-d H:i cache_path encryption_key sess_cookie_name ci_session sess_expiration 7200 sess_expire_on_close sess_encrypt_cookie sess_use_database sess_table_name ci_sessions sess_match_ip sess_match_useragent 1 sess_time_to_update 300 cookie_prefix cookie_domain cookie_path / cookie_secure global_xss_filtering csrf_protection csrf_token_name csrf_test_name csrf_cookie_name csrf_cookie_name csrf_expire 7200 compress_output time_reference local rewrite_short_tags proxy_ips
[eluser]pickupman[/eluser]
It looks like the proper query is being run. Just for what happens if the callback always returns false. You should also probably be checking that you are not passing an empty username n your callback. Don't comapre you result to a fixed number. Should use ->num_rows() > 0.
[eluser]terry101[/eluser]
Bingo!!, it was Code: if ($verifyusername->num_rows() > 0) {
[eluser]Mirge[/eluser]
[quote author="Mirge" date="1313224837"]echo $verifyusername->num_rows().. make sure the value IS actually "1". I purposely left off the "==1" part.[/quote] nobody listens to me.
[eluser]terry101[/eluser]
lol my bad mirge, i believe i misread what you wrote. I apologize. Thank you soo much for your assistance. :-) |
Welcome Guest, Not a member yet? Register Sign In |