Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

863 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

28 Experts available now in Live!

Get 1:1 Help Now