profile system problem
Posted: Thu Mar 15, 2012 7:17 am
Alright so I have the user login and profile pages working perfectly fine, but when I try to get the user_id from my database from the person logged in I get this error
Unable to jump to row 0 on MySQL result index 5
and it has to do with this code.
Unable to jump to row 0 on MySQL result index 5
and it has to do with this code.
function fetch_current_user_id($username) { $username = mysql_real_escape_string($username); $sql = "SELECT `user_id` FROM `user_profiles` WHERE `user_username` = '{$username}'"; $result = mysql_query($sql) or die(mysql_error()); return mysql_result($result, 0) or die(mysql_error()); }the stupid thing just gives that error all over, it doesn't break anything but it gives the sql errors everywhere on every page, but it does give the uid correctly. I have messed around with the mysql_fetch_assoc and mysql_fetch_row and tried to use that as thats the data i got from googling the error and couldn't get it working, any help would be appreciated!