Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how do I pull up members who joined with the last 2 days?

Posted on 2009-07-08
2
Medium Priority
?
304 Views
Last Modified: 2012-05-07
Hi there,
how do I pull up members who joined with the 2 days?

so far I have...
(The date is also in this format in the members table)

$today = date('m-d-Y',strtotime("now"));

$connection = mysql_connect ("localhost","myuser", "mypass") or die ("Cannot make the connection");
$db = mysql_select_db ("mydb",$connection) or die ("Cannot connect to database");
$sql_query = "SELECT * FROM members WHERE datejoined='$today' ORDER BY id DESC";
$result = mysql_query($sql_query);
while ($row = mysql_fetch_row($result)){
      $member1      = "$row[0]";
}

thanks!


0
Comment
Question by:yglobal
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 24810970
try changing:
$today = date('m-d-Y',strtotime("now"));

to:
$today = date('m-d-Y',strtotime("-2 days"));

and also:
$sql_query = "SELECT * FROM members WHERE datejoined='$today' ORDER BY id DESC";

to:
$sql_query = "SELECT * FROM members WHERE datejoined>='$today' ORDER BY id DESC";
0
 

Author Closing Comment

by:yglobal
ID: 31601434
perfect! thanks !
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question