Jump to content
php.lv forumi

datubaazi vajag tabulaa


tikkai maacos

Recommended Posts

Labdien! lieta sekojosha!

 

Man vajag lai dati tiktu izvadiiti tabula piecaas kolonaas un visu laiku uz leju! bet lieta taada nekaadiigi man nesanaak.. ja pielietoju if else tad pasaakums apstaajas pie pirmaas rindas... a man vajag lai rinad buutu neierobezjoti daudz...

 

ar sho es panaacu ka visu izvada vienaa rindaa...

$result = mysql_query("SELECT * FROM dati");

echo "<center><table border='0' ><tr>";
		 $i=0  ;

while($row = mysql_fetch_array($result) )
 {
 echo $i++;

 echo "<td><img border=0 src=". $row['image'] ." width=100 height=25>";


}

echo "</td></tr></table><br><br><br>";

 

vai var luudzu kaads paliidzeet..

Link to comment
Share on other sites

Nu un kur problēma? Kur tev kādu if'u?

Tabulu nemāki html'ā uztaisīt?

echo '<table>';
while(...){
 echo '<tr>';
 echo '<td></td>';
 echo '<td></td>';
 echo '<td></td>';
 echo '<td></td>';
 echo '<td></td>';
 echo '</tr>';
}
echo '</table>';

 

EDIT: andrisp zemāk pieminētā kļūda

Edited by marcis
Link to comment
Share on other sites

Nu un kur problēma? Kur tev kādu if'u?

Tabulu nemāki html'ā uztaisīt?

echo '<table>';
while(...){
 echo '<tr>';
 echo '<td></td>';
 echo '<td></td>';
 echo '<td></td>';
 echo '<td></td>';
 echo '<td></td>';
 echo '</tr>';
}
echo '</table>';

 

EDIT: andrisp zemāk pieminētā kļūda

 

maacee ta maaku.. vienk juus domu nesparataat... paldies pats tiku galaa... ar cikliem..

 

Varam taisiit ciet!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...