User
Pass
2FA
 
 

Inserare utilizatori on-line intr-un table

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash -> Programming / Scripting / Database
Author Message1050
ENJ

[Maniac]



Status: Offline
(since 18-11-2022 11:22)
Joined: 22 May 2011
Posts: 1004, Topics: 60
Location: Harare, Zimbabwe

Reputation: 1200
Votes: 42

      Battletag: postrow.ID_BATTLE_NET} 
Post Posted: 08-04-2014, 20:44:29 | Translate post to: ... (Click for more languages)

Salutari, incerc sa fac un script php, care sa insereze intr-un tabel in HTML niste jucatori care sunt on-line intr-un joc, aici e ce am pus in PHP:
Code:
 $query = "SELECT * FROM players WHERE Online = 1";
$result = mysql_query($query) or die(mysql_errno() . ": " . mysql_error() . "\n");
$playerexists = mysql_num_rows($result);
if($playerexists == "0") {
}
else
{
while ($row= mysql_fetch_array($result))
{
     $userid = $row["id"];
     $name = $row["username"];
     $level = $row["Level"];
     $faction = $row["Member"];
     $template->assign_vars(array(
     'LEVEL'         => $level,
     'NUMEPLAYER' => $name,
     ));   
     if($row["Member"] == 0)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Civilian',
         ));
     }   
     if($row["Member"] == 1)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Los Santos Police Departament',
         ));
     }
     if($row["Member"] == 2)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Federal Bureau of Investigation',
         ));
     }
     if($row["Member"] == 3)
     {
         $template->assign_vars(array(
         'FACTION'         => 'National Guard',
         ));
     }
     if($row["Member"] == 4)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Paramedic Departament',
         ));
     }
     if($row["Member"] == 5)
     {
         $template->assign_vars(array(
         'FACTION'         => 'The Mafia',
         ));
     }
     if($row["Member"] == 6)
     {
         $template->assign_vars(array(
         'FACTION'         => 'The Triads',
         ));
     }
     if($row["Member"] == 8)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Hitman Agency',
         ));
     }
     if($row["Member"] == 9)
     {
         $template->assign_vars(array(
         'FACTION'         => 'News Reporter',
         ));
     }
     if($row["Member"] == 10)
     {
         $template->assign_vars(array(
         'FACTION'         => 'School Instructor',
         ));
     }
     if($row["Member"] == 11)
     {
         $template->assign_vars(array(
         'FACTION'         => 'TaxiCab Company',
         ));
     }
     if($row["Member"] == 12)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Grove Street',
         ));
     }
     if($row["Member"] == 13)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Ballas',
         ));
     }
     if($row["Member"] == 14)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Los Santos Vagos',
         ));
     }
     if($row["Member"] == 15)
     {
         $template->assign_vars(array(
         'FACTION'         => 'Varrios Los Aztecas',
         ));
     }
}
}

Si aici am HTML:
Code:
 <center><table class="tg" style="table-layout: fixed; width: 328px">
<colgroup>
<col style="width: 192px">
<col style="width: 146px">
<col style="width: 205px">
<col style="width: 146px">
</colgroup>
<tr>
<th class="tg-031e">Player name<br></th>
<th class="tg-031e">Level</th>
<th class="tg-031e">Faction</th>
</tr>
<tr>
<td class="tg-031e"><center>{NUMEPLAYER}</center></td>
<td class="tg-031e"><center>{LEVEL}</center></td>
<td class="tg-031e"><center>{FACTION}</center></td>
</tr>
</table></center>

Nu stiu cum sa fac sa ia toate conturile din baza de date cu $row online 1 si sa le puna in tabel.
Niste sfaturi va rog?

0 0
  
Back to top
View user's profile Send private message
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash -> Programming / Scripting / Database  


The time now is 05-02-2025, 03:48:15
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password