lundi 21 avril 2014

function(excerpt) inside mysql_result


Vote count:

0




I dont know where or how to put the function inside the mysql_result.



<?php
function excerpts($string, $word_limit = 30) {
$words = explode(" ",$string);

return implode(" ",array_splice($words,0,$word_limit)); }
$per_page = 5;
$result=mysql_query("SELECT * FROM tblannouncement ORDER BY annTime DESC");
$total_results = mysql_num_rows($result);
$total_pages = ceil($total_results / $per_page);
if (isset($_GET['page']) && is_numeric($_GET['page']))
{
//PAGING CODE HERE
for ($i = $start; $i < $end; $i++)
{
if ($i == $total_results) { break; }

while($row = mysql_fetch_array($result))
{

<div class="pangContent">
<td>'. mysql_result($result, $i, 'annContent') .'</td>'. excerpts($row['annContent'],20) . '...<br /><a href="/try.php">Read more</a></div>


in the code



<td>'. mysql_result($result, $i, 'annContent') .'</td>'. excerpts($row['annContent'],20) . '...<br /><a href="/try.php">Read more</a></div>


i dont know how or where i put the excerpt



asked 49 secs ago






Aucun commentaire:

Enregistrer un commentaire