PHP+MYSQL+HTML question...
#1

Hi guys...

I have a question... how to show top 10 most rich players on my website... i know the basics from php, mysql, html and css, but only the BASICS.

Here is my code:
PHP код:
<?php 
    
include('../konekcija.php'); 
    
$proveripari mysql_query("SELECT * FROM Igraci ORDER BY pCash LIMIT 10");
    while (
$row mysql_fetch_array($proveripari)) 
    {
          
$ime $row["pProfil"];
        
$pari $row["pCash"];
    }
?>
and after this shit i have:
Код HTML:
<table id='desnastrana-tabela'>
<thead>
<th>Бр</th><th>Име</th><th>Држ</th><th>Богатство</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td><?php$ime?></td>
</tr>
</tbody>
and its showing just blank field...
Reply
#2

You had some errors in there, anyways I am not a professional php coder, but I have knowledge about php, the code below should work.

pawn Код:
<?php  
    include('../konekcija.php');  //include.
    $proveripari = mysql_query("SELECT pProfil, pCash FROM Igraci ORDER BY pCash DESC LIMIT 10;"); //selects, pProfil, pCash and order pCash them by 10.
    if( mysql_num_rows($proveripari) > 0) //if the row is more than 0, if no accounts registered the row will print none.
    {//opening bracket 1
        while ($row = mysql_fetch_array($proveripari))  
        {//opening bracket 2
            echo"{$row['pProfil']}"; //shows the pProfil of the player
            echo"{$row['pCash']}"; //shows the pCash of the player
        }//closing bracket 1
    }//closing bracket 2
?>
Reply
#3

OMG DUDE IT WORKS

I LOVE YOU

REP +1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)