Jump to content

ArshSingh

Members
  • Content count

    49
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ArshSingh

  • Rank
    Member
  1. there was nuthing to do rewrite things , noob me was using while loop . thnx to kicken now all is working good and smoothly . kicken 's answer worked
  2. please see this screenshot for columns: http://prntscr.com/5l52ip
  3. yes im working on localhost and also my db is on local as i'm using MAMP PRO for mac ,, and btw , i do have also other functions which are working with databse and doing their work successfully and getting the result from database expect this one. will get you the columns structure.
  4. yes i do get same value for those variables
  5. i'm not getting the $_GET from an input , it's directly from url in this way : locahost/easy/u/5 also the output of $_GET is : string(1) "5"
  6. as always result is "NULL" there is a user with id : 5 , but it returns NULL with variable value , and with static number in execute() it resutnr the result with user details (this is what need to come as result).
  7. this is what i get on var_dump of $user_id string(1) "5"
  8. this is a var_dump of query : object(stdClass)#7 (5) { ["username"]=> string(5) "admin" ["email"]=> string(15) "admin@gmail.com" ["profile_pic"]=> string(14) "1419529017.jpg" ["id"]=> string(1) "5" ["active"]=> string(3) "Yes"
  9. Well sorry if i'm not able to explain the situation a bit more in detail , as i too don't have any other clue of what is happening. Anyway thanks for the help and this is a result of query after putting static number value in query : object(stdClass)#7 (5) { ["username"]=> string(5) "admin" ["email"]=> string(15) "admin@gmail.com" ["profile_pic"]=> string(14) "1419529017.jpg" ["id"]=> string(1) "5" ["active"]=> string(3) "Yes"
  10. if return $user_det is not inside while loop and no result comes from query it gives me undefined $user_det variable error but with an static number value '5' it works smoothly , i'm returning this array as i'm working on different structure and i don't want to use : $row['username] something like this. i'm converting the array to object as i need the array to work in the following way : $user->username not like this : $user[0]['username'] , it's just part of my program structure , including and excluding everything we come back to the odd problem : why it is reacting in that way , and not returning and result if used variable at the place of static number value.
  11. Well result of var_dump is : string 0 '5'
  12. when using $user it returns "NULL" but when i put static value '5' it returns the array with all details. and what do you mean with : Did you notice the key difference in your two statements?
  13. When i put a static value to : $stmt->execute(array(':user_id'=>$user)); -> $stmt->execute(array(':user_id'=>'5')); it works and returns the result , and this is what i'm submiting to the function profile_view() , and i have also done _ var_dump of $user before query and it shows me the correct vaulue of what $_GET is getting from url.
  14. inside function i'm declaring that $user = $user_id; and this does not seems to be connected the problem at all
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.