php - MySQL query parse error -
$week_leave = mysql_query("select count(id),leave.id `leave`, `users` leave.backgroundcolor = 'green' , leave.id=(select u_id `users` users.username='$_session['username']')");
gives following error:
parse error: syntax error, unexpected '' (t_encapsed_and_whitespace), expecting identifier (t_string) or variable (t_variable) or number (t_num_string)
i know problem lies in sub query. suggestions ?
try have set data vetween curly braces {$_session['username']}
$week_leave = mysql_query("select count(id),leave.id `leave`, `users` leave.backgroundcolor = 'green' , leave.id=(select u_id `users` users.username='{$_session['username']}')");
Comments
Post a Comment