tomyknoker
04-14-2007, 01:22 AM
I have the following code
$results = mysql_query("SELECT * FROM `tblmembers` WHERE `member` = 'P'");
if (mysql_num_rows($results) < 1) {
die('No members were approved last month');
}
else {
while ($qry = mysql_fetch_array($results)) {
if (strtotime($qry['loginDateTime']) <= (time() + 86400*31)) {
$login .= 'Name: '.$qry["FirstName"].' '.$qry["LastName"].' ('.date("d/m/Y", strtotime($qry["JoinDate"])).') '.$qry["Email"].''.$qry["r_id"].' ('.$qry["State"].')
';
}
}
The 'r_id' is an ID from another table in my databse, so it outputs the ID number, but I want to pull the FirstName & LastName from that table so if the 'r_id' = 5 and 5 = Joe Bloggs I want to output that, just not sure how to do it, as it means another Query... I can explain further if this is a weak explanantion :)
$results = mysql_query("SELECT * FROM `tblmembers` WHERE `member` = 'P'");
if (mysql_num_rows($results) < 1) {
die('No members were approved last month');
}
else {
while ($qry = mysql_fetch_array($results)) {
if (strtotime($qry['loginDateTime']) <= (time() + 86400*31)) {
$login .= 'Name: '.$qry["FirstName"].' '.$qry["LastName"].' ('.date("d/m/Y", strtotime($qry["JoinDate"])).') '.$qry["Email"].''.$qry["r_id"].' ('.$qry["State"].')
';
}
}
The 'r_id' is an ID from another table in my databse, so it outputs the ID number, but I want to pull the FirstName & LastName from that table so if the 'r_id' = 5 and 5 = Joe Bloggs I want to output that, just not sure how to do it, as it means another Query... I can explain further if this is a weak explanantion :)