php - I'm not able to display users data -
this question has answer here:
it says:
- warning: missing argument 1 users_data()
- notice: undefined variable: user_id
- 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
Post a Comment