Ben senaryoyu şu var:
$cbid = 0;
$arrayid = 0;
while ($FINDNEWSresult = mysql_fetch_array($FINDNEWSquery)) {
echo "<tr>";
// Prvi stolpec - označevanje (checkbox)
echo "<td class=\"middlerow checkbox\"><input id=\"" . $FINDNEWSresult['NEWSid'] . "\" type=\"checkbox\" /></td>";
echo "<td class=\"middlerow\"><a class=\"ahover\" href=\"?mod=news&command=edit&edit=true&id=" . $FINDNEWSresult['NEWSid'] ."\">" . substr($FINDNEWSresult['NEWStitle'], 0, $MOD_NEWStextlimit) . "</a></td>";
echo "<td class=\"middlerow\"><a class=\"ahover\" href=\"?mod=news&command=edit&edit=true&id=" . $FINDNEWSresult['NEWSid'] ."\">" . substr($FINDNEWSresult['NEWStext'], 0, $MOD_NEWStextlimit) . "</a></td>";
echo "<td class=\"middlerow\">" . $FINDNEWSresult['NEWSuser'] . "</td>";
echo "<td class=\"middlerow\">" . $FINDNEWSresult['NEWSdate'] . "</td>";
echo "</tr>";
$NEWSarray = array ( $arrayid => array ( "Id" => $FINDNEWSresult['NEWSid'],
"Title" => $FINDNEWSresult['NEWStitle'],
"Text" => $FINDNEWSresult['NEWStext'],
"User" => $FINDNEWSresult['NEWSuser'],
"Date" => $FINDNEWSresult['NEWSdate']
)
);
// Povecaj $cb zarad checkbox id
$cbid++;
$arrayid++;
}
How to modify script, that array will be filled with each news? Currently, array stores only last news.
Yardımın için teşekkürler!