Jump to content
php.lv forumi

tabula


Gochix
 Share

Recommended Posts

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Liecies mierā cilvēk, tev tikai liekas, ka tev tas ir vajadzīgs. Un nevienam citam tas arī nekad nebūs vajadzīgs. Izej ārā, ieelpo svaigu gaisu.

Ejiet visi mājās, nav vērts. Izslēdzam gaismu, aizveram aiz sevis topiku un viss. Ejiet visi mājās. 

aizej pie aarsta

Link to comment
Share on other sites

un kā tev, @codez, izdodas saprast "ko viņi īstenībā vēlas"?

 

 

kaa iznemt no db takaa row number tjip ieliekot info db paradas number un tad pec katas attiecigi pieskirt number 1,2,3 utt

 

iz pilnīgi sasvīdu, domādams ko nozīmē tie "number ... number ... number 1,2,3 utt"

Link to comment
Share on other sites

Ja ieliktu vairāk no tā koda, varētu vairāk palīdzēt.

 

<?php
$connection = mysql_connect('localhost', 'root', 'pass'); //The Blank string is the password
mysql_select_db('db');


$query = "SELECT * FROM status ORDER BY name ASC"; //You don't need a ; like you do in SQL
$result = mysql_query($query);


echo "<table align=center borderColor=#282617 width=500 border=1 cellPadding=0 cellspacing=0>"; // start a table tag in the HTML


while($row = mysql_fetch_array($result)){   //Creates a loop to loop through results
echo "<tr><td align=center width=30><font color=white>" . šeit vajag būt tam $i bet nestrādā ."</td></font><td align=center width=80><font color=white>" . $row['char_name'] ."</td></font><td align=center width=70><font color=white>" . $row['char_class'] . "</td></font><td align=center width=120><font color=white>" . $row['char_guild'] . "</td></font><td align=center width=40><font color=white>" . $row['char_level'] . "</td></font><td align=center width=60><font color=white>" . $row['char_gametime'] . "</td></font><td align=center width=95><font color=white>" . $row['char_profaccount'] . "</td></font></tr>";  //$row['index'] the index here is a field name
}


echo "</table>"; //Close the table in HTML


mysql_close(); //Make sure to close out the database connection
?>

tur parādīts kur vajag to $i ielikt..

 

ok ieliku šādi

while($row = mysql_fetch_array($result))
for($i=1; $i<=10; $i++){   //Creates a loop to loop through results
echo "<tr><td align=center width=30><font color=white>" . $i ."</td></font><td align=center width=80><font color=white>" . $row['char_name'] ."</td></font><td align=center width=70><font color=white>" . $row['char_class'] . "</td></font><td align=center width=120><font color=white>" . $row['char_guild'] . "</td></font><td align=center width=40><font color=white>" . $row['char_level'] . "</td></font><td align=center width=60><font color=white>" . $row['char_gametime'] . "</td></font><td align=center width=95><font color=white>" . $row['char_profaccount'] . "</td></font></tr>";  //$row['index'] the index here is a field name
}

Tad strādā, bet tikai problēma tāda, man ir db 1 ieraksts, un tad nu viņš ņem tagad to 1 ierakstu un attēlo 100 reizes.. līdz skaitlim 100..
Edited by Gochix
Link to comment
Share on other sites

Paldies, bet nu pachakareejos domaajot un beigaas sanaaca shaadi..

for( $i= 0 ; $i <= 0 ; $i++ ){
}
while($row = mysql_fetch_array($result)){   //Creates a loop to loop through results
echo "<tr><td align=center width=30><font color=white>" . $i++ ."</td></font> 

Var vērt ciet..

Edited by Gochix
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...