strong-storm Posted March 5, 2005 Report Share Posted March 5, 2005 scripts: $result = mysql_query("SELECT * FROM `book` ORDER BY `date` DESC"); while ($row = mysql_fetch_array($result)) { $id = $row["id"]; echo $id ."."; } skripts attēlo sekojoši 1.2.3.4.5. bet kā likt nodzēst to pēdējo punktu? Link to comment Share on other sites More sharing options...
Kavacky Posted March 5, 2005 Report Share Posted March 5, 2005 Pārbaudi, vai nav pēdējais elements masīvā. Ja nav, tad liek punktu. Ja ir, tad neliek. Link to comment Share on other sites More sharing options...
strong-storm Posted March 5, 2005 Author Report Share Posted March 5, 2005 ar kādu php f-ju to izdarīt? Link to comment Share on other sites More sharing options...
Kavacky Posted March 5, 2005 Report Share Posted March 5, 2005 count(<array>); Link to comment Share on other sites More sharing options...
kirils Posted March 5, 2005 Report Share Posted March 5, 2005 raxti shitaa: $result = mysql_query("SELECT * FROM `book` ORDER BY `date` DESC"); while ($row = mysql_fetch_array($result)) { $id[] = $row["id"]; } echo implode('.',$id); Link to comment Share on other sites More sharing options...
rnc Posted March 5, 2005 Report Share Posted March 5, 2005 Cik patīkami redzēt atjautīgus risinājumus. Link to comment Share on other sites More sharing options...
Klez Posted March 6, 2005 Report Share Posted March 6, 2005 $result = mysql_query("SELECT * FROM `book` ORDER BY `date` DESC"); $cik = mysql_num_rows($result); $p = 0; while ($row = mysql_fetch_array($result)) { $p++; echo $id = $row["id"]; if ($cik != $p) echo "."; } Link to comment Share on other sites More sharing options...
strong-storm Posted March 6, 2005 Author Report Share Posted March 6, 2005 paldies! Link to comment Share on other sites More sharing options...
Analgiins Posted March 7, 2005 Report Share Posted March 7, 2005 iisteniibaa shitaadas lietas daraas taa: rtrim ($text, ".") Link to comment Share on other sites More sharing options...
Recommended Posts