OK, OK, ignore the last post.
This is what i have set up as a sub in my sub file.
sub getRenewalDate
{
my($renewal_date) = @_; ##connection();
my $query = qq{SELECT DATE_FORMAT(DATE_ADD(domain_date, INTERVAL domain_period_yr YEAR), "%D,%m,%Y") FROM order_d};
my $ret_mysql = select_query($query);
my @queryresult;
@queryresult = $ret_mysql->fetchrow_array(); return $queryresult[0];
}#end of getRenewalDate subroutine Then in my working file i have the following query which displays the domains due for renewal for the specific user.
############ getting all the registered domains whose days left from expiration=renew_mails_tp in table order_d ##############
my $query_domain = qq{select * from order_d, order_m where DATE_SUB(domain_date,INTERVAL $queryresult_conf[0] DAY) <= DATE_SUB(curdate(),INTERVAL domain_period_yr YEAR) and order_m.order_id=order_d.order_id and order_m.user_id=$user_id and domain_reg="y" };
#print "query_domain = " . $query_domain . "<br>";
my $ret_mysql_domain = select_query($query_domain);
my $numrows_domain = $ret_mysql_domain->rows;
my @queryresult_domain;
############ end of getting all the registered domains whose days left from expiration=renew_mails_tp in table order_d ############## The following then displays this to the user.
print "<br><br><font face=$normal_font_style size=$normal_font_size><b>Pending Domains</b></font>";
print "<table border=1 cellspacing='2' cellpadding='2' width='90%'>";
while (@queryresult_domain = $ret_mysql_domain->fetchrow_array())
{ print "<tr>";
my $dm = getDomain($queryresult_domain[3]);
my $newdate = &_unix_to_link_date($queryresult[10]);
my $renewdate = getRenewalDate($queryresult_domain[6]);
print "<td><font face=$normal_font_style size=$normal_font_size><a href=order_plan_hosting.pl?order_recur_id=$queryresult_domain[0]&order_section=recur_domain>$queryresult_domain[2]$dm</a></td>";
print "<td><font face=$normal_font_style size=$normal_font_size>$renewdate</td>";
print "</tr>";
}
print "</table>"; But the problem is $renewdate displays the correct date, but only of the last entry in the database and not the users domain.
I though that it would only work it out based on the $queryresult_domain but im obviously missing something to get it to display the date for the domain in question. Can someone tell me what?
Regards
Mark
http://www.host4.me.uk No doubt i'll be back for more answers!