Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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 dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

827 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