i am fetching user details using date
if(date("d")==1) {
$time = "m";
}
if(date("l")=="Friday") {
$time = "w";
}
$time = "d";
$sql=mysql_query("select user from table_users where $reprt=".$time .");
while($row=mysql_fetch_Array($sql) {
$sql==mysql_query("select * from table_register where $user="$row[0]");
}
here when (date("d")==1) i want to select statement using both d and m how is that possible.
Let’s see if I got this right… you should should be doing this only in one query if I understand properly
select * from table_register where $user in (select user from table_users where $reprt=”.$time)
would be a much better query then what you have set up… still not the best but at least it’s only 1 query.
to the actual question, you should just change your code to the following
Hope this helps.