Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:52:01+00:00 2026-06-05T02:52:01+00:00

i am fetching user details using date if(date(d)==1) { $time = m; } if(date(l)==Friday)

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:52:02+00:00Added an answer on June 5, 2026 at 2:52 am

    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

    if(date("d")==1)
    {
     $time  = "m";
    }
    if(date("l")=="Friday")
    {
     $time  = "w";
    }
    
    if($time == "m") // this is when you want to also search for d right?
    {
      //we do what I suggested earlier with a slight change
      mysql_query("select * from table_register where $user in (select user from table_users where  $reprt=".$time." OR $reprt=d)");
    }
    else
    {
      //we do what I suggested earlier
      mysql_query("select * from table_register where $user in (select user from table_users where  $reprt=".$time.")");
    }
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fetching username from database when a user is logging in by his
In my XPI I am fetching javascript code from the user's PC (file://) and
This is my php script for fetching data from a db. <?php mysql_connect(host,user,pass); mysql_select_db(db);
I am currently fetching the complete user details and lists it into a html
i am fetching a page using get ajax call. $.get('/notification/viewmessage',{user:username},function(data){ //my code here });
I am fetching a user's news feed using the Facebook API and displaying some
I'm using LINQ to SQL and DataGridViews to create an editable user interface of
I am using Graph API in my application. I am fetching user's facebook wall
I am facing a problem while fetching values using paginate function in cakephp. In
Im fetching a local xml file using jQuery ajax through an html that i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.