![]() |
2 errrors when i reg on my own script
hi
well... i'm getting 2 errors when registering on my own script, can any1 8help me solve. 1st error: Code:
mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 8PHP Code:
Code:
mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 10PHP Code:
|
Both the same error effectively.
You have no results in your query, so therefore you cannot move to the first record. Use mysql_num_rows first to verify you have records in the resource. Hopefully you're not making a habit of using mysql_result. Its slow, and if you were to run both of these blocks in the same script then you query twice for information that isn't required. Query once for any information you need and use PHP to lookup what it needs from the resultset or a stored result. It's fine if you only call one and only need one at a time though, but since you can be limited in querycount per hour, you should be doing whatever you can to reduce the number of queries required. |
Thanks, now when i've regged it says: credentials not found, btw they're in the db??
here's the edited func: PHP Code:
|
sorry, this func is the 1........
PHP Code:
any help.. thx |
What is the result of a the mysql_num_rows?
|
what do you mean?
|
How many rows did this query return?
|
0 rows, must be btw users are added in db............
|
Not according to that query there isn't matching records.
Parse the statement in use and print it out. Run that same against the mysql client and see what it pulls up. It hasn't failed, assuming you have error reporting on. You should add an or die(mysql_error()) to the query though to verify. |
i added or die:
PHP Code:
i don't see what ya mean by "parse and print it" ? |
I mean print out the SQL and run it directly against a mysql client.
|
Ok done that, gives me:
Code:
SELECT user_id FROM users WHERE email = 'testing@123.net' AND password = '6bb5afb249faf144816989497934fd80'what could the prob be? here's all my user funcs: PHP Code:
|
So in PHPMyAdmin, that above runs fine and produces exactly one record, but calling login_check returns false?
See if that has a valid count off of it: PHP Code:
PHP Code:
|
It shows: Count: 0
something i forgot tomention is - as ssoon as i've regged, that's when i get "credits not found", coz it logs in straiight awy.............. |
Does it work anytime after an immediate login?
What is the chain of function calls here; none of them currently call any other, so I can't see the process. Only thing that stands out is this: PHP Code:
|
| All times are GMT +1. The time now is 06:06 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.