Hi, I have this code: while($row = mysql_fetch_object($result)) { echo "<tr>"; echo "<td>" . $row->EmailAddress . "</td>"; echo "<td>" . $row->FirstName . " " . $row->LastName . "</td>"; echo "<td>" . date('m-d-Y H:m', $row->TimeJoined) . "</td>"; $old = $row->TimeJoined; $daysOnList = time() - $old; $dd = floor($daysOnList/86400); echo "<td>" . $dd . "</td>"; echo "<td>" . $row->ReferralSource . "</td>"; echo "<td>" . $row->SentMsgs . "</td>"; Code (markup): and on the last line echo "<td>" . $row->SentMsgs . "</td>"; Code (markup): the out put is: 4,5,6,7,8,9,10,11,12 (etc. long ever changing string) And I want to only get the last value (in this case it's 12) I used: echo "<td>" . $row->SentMsgs[$i]; . "</td>"; Code (markup): and the output was only the first value (4), then read I should use the end trigger like: echo "<td>" . end($row->SentMsgs) . "</td>"; Code (markup): but it did not work. any ideas how I can do this? Thanks in advance, Mike
well I've been trying but I keep getting errors, <?php $username = "xxxxxx"; $password = "xxxxxx"; $hostname = "localhost"; $database = "xxxxxx"; $conn = mysql_connect($hostname, $username, $password) or die("Connecting to MySQL failed"); mysql_select_db($database, $conn) or die("Selecting MySQL database failed"); $sSQL = "SELECT * FROM InfResp_subscribers WHERE responderid='".$_GET['responderID']."'"; $resSQL = "SELECT * FROM InfResp_responders"; $result = mysql_query($sSQL, $conn); $resultResp = mysql_query($resSQL, $conn); while($row = mysql_fetch_object($result)) { echo "<tr>"; echo "<td>" . $row->EmailAddress . "</td>"; echo "<td>" . $row->FirstName . " " . $row->LastName . "</td>"; echo "<td>" . date('m-d-Y H:m', $row->TimeJoined) . "</td>"; $old = $row->TimeJoined; $daysOnList = time() - $old; $dd = floor($daysOnList/86400); echo "<td>" . $dd . "</td>"; echo "<td>" . $row->ReferralSource . "</td>"; echo "<td>" . $row->SentMsgs . "</td>"; try { $rt = mysql_query("SELECT MsgList FROM InfResp_responders INNER JOIN InfResp_subscribers ON InfResp_responders.ResponderID=InfResp_subscribers.ResponderID WHERE InfResp_subscribers.SubscriberID='". $row->SubscriberID ."' LIMIT 1", $conn); while($tt = mysql_fetch_object($rt)) { echo "<td>" . $tt->MsgList . "</td>"; } } catch(Exception $iop) {} echo "</tr>"; } ?> Code (markup): Thanks for all the help, Mike
If SendMsgs contains comma separated values then you can get the last value by replacing echo "<td>" . $row->SentMsgs . "</td>"; Code (php): with echo substr(strrchr($row->SentMsgs, ","), 1); Code (php):