Solved

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

Posted on 2009-07-08
2
257 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now