Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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 …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

786 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