php - I'm not able to display users data -


it says:

  1. warning: missing argument 1 users_data()
  2. notice: undefined variable: user_id
  3. warning: mysql_fetch_array() expects parameter 1 resource, boolean given

my function:

function users_data($user_id) {         $data =array();         $user_id = (int)$user_id;      $query = mysql_query("select * `sun` `user_id` ='$user_id'");     $user_data = mysql_fetch_array($query);     return $user_data; } 

what do?

i know $user_id not defined tell me how define $user_id

i have done $user_id = $_session['use_id'];; says undefined index...

then use $sql = "select * users user_id= ???" got stuck

can tell me how solve this?

please don't tell me add user_id = 1,2,3 etc. because working on login , registration form , displaying users data.

from warning 1 , clear didnt pass $user_id function


 users_data($user_id) // $user_id??? may have called function users_data()  


try pass $user_id users_data function, because warnings 2 , 3 depends on warning 1.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -