Jump to content
php.lv forumi

Recommended Posts

Posted

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?

Posted

raxti shitaa:

$result = mysql_query("SELECT * FROM `book` ORDER BY `date` DESC");
while ($row = mysql_fetch_array($result)) { 
$id[] = $row["id"];
}
echo implode('.',$id);

Posted

$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 ".";

}

×
×
  • Create New...