I would like to take the data from the MySQL table, and then use the topic_create time and the period where there is a negative number to determine the number of periods/months between the negative date and the last period.
http://bayparkcapital.com/docliste.php<?php
//connect to server
$mysqli = mysqli_connect("");
//gather the topics
$get_topics_sql = "SELECT topic_id, topic_title, DATE_FORMAT(topic_create_t
ime, '%b %e %Y at %r') aS fmt_topic_create_time, topic_owner, INV_ID,INV_U_N, MS_F_NAME, MS_ID, CONT_DIST_1_1_08, cf_1_1_00, cf_2_1_00, cf_3_1_00, cf_4_1_00, cf_5_1_00, cf_6_1_00, cf_7_1_00, cf_8_1_00, cf_9_1_00, cf_10_1_00, cf_11_1_00, cf_12_1_00, cf_1_1_01, cf_2_1_01, cf_3_1_01, cf_4_1_01, cf_5_1_01, cf_6_1_01, cf_7_1_01, cf_8_1_01, cf_9_1_01, cf_10_1_01, cf_11_1_01, cf_12_1_01, cf_1_1_02, cf_2_1_02, cf_3_1_02, cf_4_1_02, cf_5_1_02, cf_6_1_02, cf_7_1_02, cf_8_1_02, cf_9_1_02, cf_10_1_02, cf_11_1_02, cf_12_1_02, cf_1_1_03, cf_2_1_03, cf_3_1_03, cf_4_1_03, cf_5_1_03, cf_6_1_03, cf_7_1_03, cf_8_1_03, cf_9_1_03, cf_10_1_03, cf_11_1_03, cf_12_1_03, cf_1_1_04, cf_2_1_04, cf_3_1_04, cf_4_1_04, cf_5_1_04, cf_6_1_04, cf_7_1_04, cf_8_1_04, cf_9_1_04, cf_10_1_04, cf_11_1_04, cf_12_1_04, cf_1_1_05, cf_2_1_05, cf_3_1_05, cf_4_1_05, cf_5_1_05, cf_6_1_05, cf_7_1_05, cf_8_1_05, cf_9_1_05, cf_10_1_05, cf_11_1_05, cf_12_1_05, cf_1_1_06, cf_2_1_06, cf_3_1_06, cf_4_1_06, cf_5_1_06, cf_6_1_06, cf_7_1_06, cf_8_1_06, cf_9_1_06, cf_10_1_06, cf_11_1_06, cf_12_1_06, cf_1_1_07, cf_2_1_07, cf_3_1_07, cf_4_1_07, cf_5_1_07, cf_6_1_07, cf_7_1_07, cf_8_1_07, cf_9_1_07, cf_10_1_07, cf_11_1_07, cf_12_1_07, cf_1_1_08, cf_2_1_08, cf_3_1_08, cf_4_1_08, cf_5_1_08, cf_6_1_08, cf_7_1_08, cf_8_1_08, cf_9_1_08, cf_10_1_08, cf_11_1_08, cf_12_1_08 FROM invdb ORDER BY topic_create_time DESC";
$get_topics_res = mysqli_query($mysqli, $get_topics_sql) or die(mysqli_error($mysqli))
;
if (mysqli_num_rows($get_topi
cs_res) < 1) {
//there are no topics, so say so
$display_block = "<p><em>No topics exist.</em></p>";
} else {
//create the display string
$display_block = "
<table cellpadding=\"1\" cellspacing=\"1\" border=\"1\" border-color=\"black\">
<tr>
<th>Contribution Date</th>
<th> 1_00 </th>
<th> 2_00 </th>
<th> 3_00 </th>
<th> 4_00 </th>
<th> 5_00 </th>
<th> 6_00 </th>
<th> 7_00 </th>
<th> 8_00 </th>
<th> 9_00 </th>
<th> 10_00 </th>
<th> 11_00 </th>
<th> 12_00 </th>
<th> 1_01 </th>
<th> 2_01 </th>
<th> 3_01 </th>
<th> 4_01 </th>
<th> 5_01 </th>
<th> 6_01 </th>
<th> 7_01 </th>
<th> 8_01 </th>
<th> 9_01 </th>
<th> 10_01 </th>
<th> 11_01 </th>
<th> 12_01 </th>
<th> 1_02 </th>
<th> 2_02 </th>
<th> 3_02 </th>
<th> 4_02 </th>
<th> 5_02 </th>
<th> 6_02 </th>
<th> 7_02 </th>
<th> 8_02 </th>
<th> 9_02 </th>
<th> 10_02 </th>
<th> 11_02 </th>
<th> 12_02 </th>
<th> 1_03 </th>
<th> 2_03 </th>
<th> 3_03 </th>
<th> 4_03 </th>
<th> 5_03 </th>
<th> 6_03 </th>
<th> 7_03 </th>
<th> 8_03 </th>
<th> 9_03 </th>
<th> 10_03 </th>
<th> 11_03 </th>
<th> 12_03 </th>
<th> 1_04 </th>
<th> 2_04 </th>
<th> 3_04 </th>
<th> 4_04 </th>
<th> 5_04 </th>
<th> 6_04 </th>
<th> 7_04 </th>
<th> 8_04 </th>
<th> 9_04 </th>
<th> 10_04 </th>
<th> 11_04 </th>
<th> 12_04 </th>
<th> 1_05 </th>
<th> 2_05 </th>
<th> 3_05 </th>
<th> 4_05 </th>
<th> 5_05 </th>
<th> 6_05 </th>
<th> 7_05 </th>
<th> 8_05 </th>
<th> 9_05 </th>
<th> 10_05 </th>
<th> 11_05 </th>
<th> 12_05 </th>
<th> 1_06 </th>
<th> 2_06 </th>
<th> 3_06 </th>
<th> 4_06 </th>
<th> 5_06 </th>
<th> 6_06 </th>
<th> 7_06 </th>
<th> 8_06 </th>
<th> 9_06 </th>
<th> 10_06 </th>
<th> 11_06 </th>
<th> 12_06 </th>
<th> 1_07 </th>
<th> 2_07 </th>
<th> 3_07 </th>
<th> 4_07 </th>
<th> 5_07 </th>
<th> 6_07 </th>
<th> 7_07 </th>
<th> 8_07 </th>
<th> 9_07 </th>
<th> 10_07 </th>
<th> 11_07 </th>
<th> 12_07 </th>
<th> 1_08 </th>
<th> 2_08 </th>
<th> 3_08 </th>
<th> 4_08 </th>
<th> 5_08 </th>
<th> 6_08 </th>
<th> 7_08 </th>
<th> 8_08 </th>
<th> 9_08 </th>
<th> 10_08 </th>
<th> 11_08 </th>
<th> 12_08 </th>
</tr>";
while ($topic_info = mysqli_fetch_array($get_to
pics_res))
{
$topic_id = $topic_info['topic_id'];
$topic_title = stripslashes($topic_info['
topic_titl
e']);
$topic_create_time = $topic_info['fmt_topic_cre
ate_time']
;
$topic_owner = stripslashes($topic_info['
topic_owne
r']);
$filename = stripslashes($topic_info['
filename']
);
$topic_id = $topic_info['topic_id'];
$topic_title = stripslashes($topic_info['
topic_titl
e']);
$topic_create_time = $topic_info['fmt_topic_cre
ate_time']
;
$topic_owner = stripslashes($topic_info['
topic_owne
r']);
$filename = stripslashes($topic_info['
filename']
);
$INV_ID = stripslashes($topic_info['
INV_ID']);
$INV_U_N = stripslashes($topic_info['
INV_U_N'])
;
$MS_F_NAME = stripslashes($topic_info['
MS_F_NAME'
]);
$MS_ID = stripslashes($topic_info['
MS_ID']);
$CHECK = stripslashes($topic_info['
CHECK']);
$INV_ID = stripslashes($topic_info['
INV_ID']);
$MS_INV_ID = stripslashes($topic_info['
MS_INV_ID'
]);
$CONT_DIST_1_1_08 = stripslashes($topic_info['
CONT_DIST_
1_1_08']);
$cf_1_1_00 = $topic_info['cf_1_1_00'];
$cf_2_1_00 = $topic_info['cf_2_1_00'];
$cf_3_1_00 = $topic_info['cf_3_1_00'];
$cf_4_1_00 = $topic_info['cf_4_1_00'];
$cf_5_1_00 = $topic_info['cf_5_1_00'];
$cf_6_1_00 = stripslashes($topic_info['
cf_6_1_00'
]);
$cf_7_1_00 = stripslashes($topic_info['
cf_7_1_00'
]);
$cf_8_1_00 = stripslashes($topic_info['
cf_8_1_00'
]);
$cf_9_1_00 = stripslashes($topic_info['
cf_9_1_00'
]);
$cf_10_1_00 = stripslashes($topic_info['
cf_10_1_00
']);
$cf_11_1_00 = stripslashes($topic_info['
cf_11_1_00
']);
$cf_12_1_00 = stripslashes($topic_info['
cf_12_1_00
']);
$cf_1_1_01 = stripslashes($topic_info['
cf_1_1_01'
]);
$cf_2_1_01 = stripslashes($topic_info['
cf_2_1_01'
]);
$cf_3_1_01 = stripslashes($topic_info['
cf_3_1_01'
]);
$cf_4_1_01 = stripslashes($topic_info['
cf_4_1_01'
]);
$cf_5_1_01 = stripslashes($topic_info['
cf_5_1_01'
]);
$cf_6_1_01 = stripslashes($topic_info['
cf_6_1_01'
]);
$cf_7_1_01 = stripslashes($topic_info['
cf_7_1_01'
]);
$cf_8_1_01 = stripslashes($topic_info['
cf_8_1_01'
]);
$cf_9_1_01 = stripslashes($topic_info['
cf_9_1_01'
]);
$cf_10_1_01 = stripslashes($topic_info['
cf_10_1_01
']);
$cf_11_1_01 = stripslashes($topic_info['
cf_11_1_01
']);
$cf_12_1_01 = stripslashes($topic_info['
cf_12_1_01
']);
$cf_1_1_02 = stripslashes($topic_info['
cf_1_1_02'
]);
$cf_2_1_02 = stripslashes($topic_info['
cf_2_1_02'
]);
$cf_3_1_02 = stripslashes($topic_info['
cf_3_1_02'
]);
$cf_4_1_02 = stripslashes($topic_info['
cf_4_1_02'
]);
$cf_5_1_02 = stripslashes($topic_info['
cf_5_1_02'
]);
$cf_6_1_02 = stripslashes($topic_info['
cf_6_1_02'
]);
$cf_7_1_02 = stripslashes($topic_info['
cf_7_1_02'
]);
$cf_8_1_02 = stripslashes($topic_info['
cf_8_1_02'
]);
$cf_9_1_02 = stripslashes($topic_info['
cf_9_1_02'
]);
$cf_10_1_02 = stripslashes($topic_info['
cf_10_1_02
']);
$cf_11_1_02 = stripslashes($topic_info['
cf_11_1_02
']);
$cf_12_1_02 = stripslashes($topic_info['
cf_12_1_02
']);
$cf_1_1_03 = stripslashes($topic_info['
cf_1_1_03'
]);
$cf_2_1_03 = stripslashes($topic_info['
cf_2_1_03'
]);
$cf_3_1_03 = stripslashes($topic_info['
cf_3_1_03'
]);
$cf_4_1_03 = stripslashes($topic_info['
cf_4_1_03'
]);
$cf_5_1_03 = stripslashes($topic_info['
cf_5_1_03'
]);
$cf_6_1_03 = stripslashes($topic_info['
cf_6_1_03'
]);
$cf_7_1_03 = stripslashes($topic_info['
cf_7_1_03'
]);
$cf_8_1_03 = stripslashes($topic_info['
cf_8_1_03'
]);
$cf_9_1_03 = stripslashes($topic_info['
cf_9_1_03'
]);
$cf_10_1_03 = stripslashes($topic_info['
cf_10_1_03
']);
$cf_11_1_03 = stripslashes($topic_info['
cf_11_1_03
']);
$cf_12_1_03 = stripslashes($topic_info['
cf_12_1_03
']);
$cf_1_1_04 = stripslashes($topic_info['
cf_1_1_04'
]);
$cf_2_1_04 = stripslashes($topic_info['
cf_2_1_04'
]);
$cf_3_1_04 = stripslashes($topic_info['
cf_3_1_04'
]);
$cf_4_1_04 = stripslashes($topic_info['
cf_4_1_04'
]);
$cf_5_1_04 = stripslashes($topic_info['
cf_5_1_04'
]);
$cf_6_1_04 = stripslashes($topic_info['
cf_6_1_04'
]);
$cf_7_1_04 = stripslashes($topic_info['
cf_7_1_04'
]);
$cf_8_1_04 = stripslashes($topic_info['
cf_8_1_04'
]);
$cf_9_1_04 = stripslashes($topic_info['
cf_9_1_04'
]);
$cf_10_1_04 = stripslashes($topic_info['
cf_10_1_04
']);
$cf_11_1_04 = stripslashes($topic_info['
cf_11_1_04
']);
$cf_12_1_04 = stripslashes($topic_info['
cf_12_1_04
']);
$cf_1_1_05 = stripslashes($topic_info['
cf_1_1_05'
]);
$cf_2_1_05 = stripslashes($topic_info['
cf_2_1_05'
]);
$cf_3_1_05 = stripslashes($topic_info['
cf_3_1_05'
]);
$cf_4_1_05 = stripslashes($topic_info['
cf_4_1_05'
]);
$cf_5_1_05 = stripslashes($topic_info['
cf_5_1_05'
]);
$cf_6_1_05 = stripslashes($topic_info['
cf_6_1_05'
]);
$cf_7_1_05 = stripslashes($topic_info['
cf_7_1_05'
]);
$cf_8_1_05 = stripslashes($topic_info['
cf_8_1_05'
]);
$cf_9_1_05 = stripslashes($topic_info['
cf_9_1_05'
]);
$cf_10_1_05 = stripslashes($topic_info['
cf_10_1_05
']);
$cf_11_1_05 = stripslashes($topic_info['
cf_11_1_05
']);
$cf_12_1_05 = stripslashes($topic_info['
cf_12_1_05
']);
$cf_1_1_06 = stripslashes($topic_info['
cf_1_1_06'
]);
$cf_2_1_06 = stripslashes($topic_info['
cf_2_1_06'
]);
$cf_3_1_06 = stripslashes($topic_info['
cf_3_1_06'
]);
$cf_4_1_06 = stripslashes($topic_info['
cf_4_1_06'
]);
$cf_5_1_06 = stripslashes($topic_info['
cf_5_1_06'
]);
$cf_6_1_06 = stripslashes($topic_info['
cf_6_1_06'
]);
$cf_7_1_06 = stripslashes($topic_info['
cf_7_1_06'
]);
$cf_8_1_06 = stripslashes($topic_info['
cf_8_1_06'
]);
$cf_9_1_06 = stripslashes($topic_info['
cf_9_1_06'
]);
$cf_10_1_06 = stripslashes($topic_info['
cf_10_1_06
']);
$cf_11_1_06 = stripslashes($topic_info['
cf_11_1_06
']);
$cf_12_1_06 = stripslashes($topic_info['
cf_12_1_06
']);
$cf_1_1_07 = stripslashes($topic_info['
cf_1_1_07'
]);
$cf_2_1_07 = stripslashes($topic_info['
cf_2_1_07'
]);
$cf_3_1_07 = stripslashes($topic_info['
cf_3_1_07'
]);
$cf_4_1_07 = stripslashes($topic_info['
cf_4_1_07'
]);
$cf_5_1_07 = stripslashes($topic_info['
cf_5_1_07'
]);
$cf_6_1_07 = stripslashes($topic_info['
cf_6_1_07'
]);
$cf_7_1_07 = stripslashes($topic_info['
cf_7_1_07'
]);
$cf_8_1_07 = stripslashes($topic_info['
cf_8_1_07'
]);
$cf_9_1_07 = stripslashes($topic_info['
cf_9_1_07'
]);
$cf_10_1_07 = stripslashes($topic_info['
cf_10_1_07
']);
$cf_11_1_07 = stripslashes($topic_info['
cf_11_1_07
']);
$cf_12_1_07 = stripslashes($topic_info['
cf_12_1_07
']);
$cf_1_1_08 = stripslashes($topic_info['
cf_1_1_08'
]);
$cf_2_1_08 = stripslashes($topic_info['
cf_2_1_08'
]);
$cf_3_1_08 = stripslashes($topic_info['
cf_3_1_08'
]);
$cf_4_1_08 = stripslashes($topic_info['
cf_4_1_08'
]);
$cf_5_1_08 = stripslashes($topic_info['
cf_5_1_08'
]);
$cf_6_1_08 = stripslashes($topic_info['
cf_6_1_08'
]);
$cf_7_1_08 = stripslashes($topic_info['
cf_7_1_08'
]);
$cf_8_1_08 = stripslashes($topic_info['
cf_8_1_08'
]);
$cf_9_1_08 = stripslashes($topic_info['
cf_9_1_08'
]);
$cf_10_1_08 = stripslashes($topic_info['
cf_10_1_08
']);
$cf_11_1_08 = stripslashes($topic_info['
cf_11_1_08
']);
$cf_12_1_08 = stripslashes($topic_info['
cf_12_1_08
']);
//add to display
$display_block .= "
<tr>
<td>".$topic_create_time."
</td>
<th>".$CONT_DIST_1_1_08."<
/th>
<th>".$cf_2_1_00."</th>
<th>".$cf_3_1_00."</th>
<th>".$cf_4_1_00."</th>
<th>".$cf_5_1_00."</th>
<th>".$cf_6_1_00."</th>
<th>".$cf_7_1_00."</th>
<th>".$cf_8_1_00."</th>
<th>".$cf_9_1_00."</th>
<th>".$cf_10_1_00."</th>
<th>".$cf_11_1_00."</th>
<th>".$cf_12_1_00."</th>
<th>".$cf_1_1_01."</th>
<th>".$cf_2_1_01."</th>
<th>".$cf_3_1_01."</th>
<th>".$cf_4_1_01."</th>
<th>".$cf_5_1_01."</th>
<th>".$cf_6_1_01."</th>
<th>".$cf_7_1_01."</th>
<th>".$cf_8_1_01."</th>
<th>".$cf_9_1_01."</th>
<th>".$cf_10_1_01."</th>
<th>".$cf_11_1_01."</th>
<th>".$cf_12_1_01."</th>
<th>".$cf_1_1_02."</th>
<th>".$cf_2_1_02."</th>
<th>".$cf_3_1_02."</th>
<th>".$cf_4_1_02."</th>
<th>".$cf_5_1_02."</th>
<th>".$cf_6_1_02."</th>
<th>".$cf_7_1_02."</th>
<th>".$cf_8_1_02."</th>
<th>".$cf_9_1_02."</th>
<th>".$cf_10_1_02."</th>
<th>".$cf_11_1_02."</th>
<th>".$cf_12_1_02."</th>
<th>".$cf_1_1_03."</th>
<th>".$cf_2_1_03."</th>
<th>".$cf_3_1_03."</th>
<th>".$cf_4_1_03."</th>
<th>".$cf_5_1_03."</th>
<th>".$cf_6_1_03."</th>
<th>".$cf_7_1_03."</th>
<th>".$cf_8_1_03."</th>
<th>".$cf_9_1_03."</th>
<th>".$cf_10_1_03."</th>
<th>".$cf_11_1_03."</th>
<th>".$cf_12_1_03."</th>
<th>".$cf_1_1_04."</th>
<th>".$cf_2_1_04."</th>
<th>".$cf_3_1_04."</th>
<th>".$cf_4_1_04."</th>
<th>".$cf_5_1_04."</th>
<th>".$cf_6_1_04."</th>
<th>".$cf_7_1_04."</th>
<th>".$cf_8_1_04."</th>
<th>".$cf_9_1_04."</th>
<th>".$cf_10_1_04."</th>
<th>".$cf_11_1_04."</th>
<th>".$cf_12_1_04."</th>
<th>".$cf_1_1_05."</th>
<th>".$cf_2_1_05."</th>
<th>".$cf_3_1_05."</th>
<th>".$cf_4_1_05."</th>
<th>".$cf_5_1_05."</th>
<th>".$cf_6_1_05."</th>
<th>".$cf_7_1_05."</th>
<th>".$cf_8_1_05."</th>
<th>".$cf_9_1_05."</th>
<th>".$cf_10_1_05."</th>
<th>".$cf_11_1_05."</th>
<th>".$cf_12_1_05."</th>
<th>".$cf_1_1_06."</th>
<th>".$cf_2_1_06."</th>
<th>".$cf_3_1_06."</th>
<th>".$cf_4_1_06."</th>
<th>".$cf_5_1_06."</th>
<th>".$cf_6_1_06."</th>
<th>".$cf_7_1_06."</th>
<th>".$cf_8_1_06."</th>
<th>".$cf_9_1_06."</th>
<th>".$cf_10_1_06."</th>
<th>".$cf_11_1_06."</th>
<th>".$cf_12_1_06."</th>
<th>".$cf_1_1_07."</th>
<th>".$cf_2_1_07."</th>
<th>".$cf_3_1_07."</th>
<th>".$cf_4_1_07."</th>
<th>".$cf_5_1_07."</th>
<th>".$cf_6_1_07."</th>
<th>".$cf_7_1_07."</th>
<th>".$cf_8_1_07."</th>
<th>".$cf_9_1_07."</th>
<th>".$cf_10_1_07."</th>
<th>".$cf_11_1_07."</th>
<th>".$cf_12_1_07."</th>
<th>".$cf_1_1_08."</th>
<th>".$cf_2_1_08."</th>
<th>".$cf_3_1_08."</th>
<th>".$cf_4_1_08."</th>
<th>".$cf_5_1_08."</th>
<th>".$cf_6_1_08."</th>
<th>".$cf_7_1_08."</th>
<th>".$cf_8_1_08."</th>
<th>".$cf_9_1_08."</th>
<th>".$cf_10_1_08."</th>
<th>".$cf_11_1_08."</th>
<th>".$cf_12_1_08."</th>
</tr>";
}
//free results
mysqli_free_result($get_to
pics_res);
//close connection to mysqli
mysqli_close($mysqli);
//close up the table
$display_block .= "</table>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
>
<head>
<meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" /><meta name="keywords" content="Members Page">
<meta name="Description" content="Members Page">
<title>Member Page</title>
</head>
<body>
<div id="nav_top"><a href="/">Home</a> | <a href="/about">About Us</a> | <a href="/contact">Contact</a
> | <a href="/site map">Site Map</a>| <a href="/login">Log Out</a></div>
<div id="bkg" style="width:auto;">
<div id="body">
<p><span class="heading" style="width:400px; padding-top:20px;">View Your Internal Rate of Return</span></p>
<?php echo $display_block; ?></th>
</div>
</div>
</body>
</html>
Start Free Trial