Don´t say, I know, I really need to learn more.
Posted: Thu Aug 18, 2011 10:54 pm
Now I did follow the user register system + cookie + Email activation and all is working just ( expect that I don´t get the mail but that I will look in to later. ) Now my problem is I can get the user id from my database but if I want to pull more date all I get is the same user id number.
Now I think should me a Mysql_fetch_array here but what my problem is I don´t know how to pull the user id out from the other function.
I can echo it out on the protected.php with $user_info = get_userid($u_id); + <p>User id: <?php echo $user_info['id']; ?></p> That shows the right user id but if I try the fetch array from the user profile video I get many errors and I did try to check them but its not syntax errors.
I did try to create a myslq_fetch_array(); for todays now but its still not working. any idea?
Best regards
Wuzzuriz
// This is to get the username $u_id= $_SESSION['username']; // here I take the username and make it to user_id. function get_userid($u_id){ $sql = "SELECT `user_id` AS `id`, `user_weight` AS `weight` FROM `users` WHERE `user_name` ='{$u_id}'"; $data = mysql_query($sql); return mysql_result($data, 0); }
Now I think should me a Mysql_fetch_array here but what my problem is I don´t know how to pull the user id out from the other function.
I can echo it out on the protected.php with $user_info = get_userid($u_id); + <p>User id: <?php echo $user_info['id']; ?></p> That shows the right user id but if I try the fetch array from the user profile video I get many errors and I did try to check them but its not syntax errors.
I did try to create a myslq_fetch_array(); for todays now but its still not working. any idea?
Best regards
Wuzzuriz