Szerző Téma: MySql / PHP Gond  (Megtekintve 851 alkalommal)

Nem elérhető Live

  • 507
    • Profil megtekintése
MySql / PHP Gond
« Dátum: 2013. Április 14. - 21:13:58 »
0 Show voters
Üdv!
Igazából nem is tudok, hogy ezt most hova nyissam ezért ide nyitottam.
Tehát elkezdtem csinálni egy \"onlinegame\" webes scriptet, de az a baj hogy nem írja ki az adatokat..
 
<?php
if($_GET[\"page\"] == \"onlinegame\")
{
$result = mysql_query(\"SELECT `status`, `score`, `lastwinner` FROM `onlinegame`\");
echo mysql_error();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{   
$status = $row[\'status\'];
$score = $row[\'score\'];
$lastwinner = $row[\'lastwinner\'];
if($status == 0) $status = \"<font color=\'red\'>inaktív</font>\";
if($status == 1) $status = \"<font color=\'green\'>aktív</font>\";
echo \"
   A játék jelenleg $status<br>
   Megnyerhetõ pont: $score<br>
   Utolsó nyertes: $lastwinner\";
}
}
?>

 
Üdv,

Live

Nem elérhető Zack

  • 433
    • Profil megtekintése
MySql / PHP Gond
« Válasz #1 Dátum: 2013. Április 14. - 21:41:28 »
0 Show voters
MySQL-re hol csatlakozik?

Nem elérhető Norby

  • 1575
    • Profil megtekintése
MySql / PHP Gond
« Válasz #2 Dátum: 2013. Április 14. - 23:34:17 »
0 Show voters
Ebben nem látok hibát máshol lesz a gond szerintem.

Nem elérhető Live

  • 507
    • Profil megtekintése
MySql / PHP Gond
« Válasz #3 Dátum: 2013. Április 15. - 17:54:00 »
0 Show voters
Hát nem tudom mert elõtte vannak egyéb dolgok, mint például bannolt játékosok.. és rendesen mûködik, nem tudom mi lehet a baj :(
Újból írom hátha valamit elírtam valahol.

Nem elérhető Sheet

  • 1508
  • Támogató
    • Profil megtekintése
MySql / PHP Gond
« Válasz #4 Dátum: 2013. Április 15. - 18:07:03 »
0 Show voters
<?php
if($_GET[\"page\"] == \"onlinegame\")
{
        $result = mysql_query(\"SELECT `status`, `score`, `lastwinner` FROM `onlinegame`\");
        echo mysql_error();
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
        {     
                $status = $row[\'status\'];
                $score = $row[\'score\'];
                $lastwinner = $row[\'lastwinner\'];
                if($status == 0) $status = \"<font color=\'red\'>inaktív</font>\";
                if($status == 1) $status = \"<font color=\'green\'>aktív</font>\";
                echo \"
                        A játék jelenleg\".$status.\"<br>
                        Megnyerhetõ pont:\".$score.\"<br>
                        Utolsó nyertes:\".$lastwinner.\"\";
        }
}
?>

Nem elérhető Live

  • 507
    • Profil megtekintése
MySql / PHP Gond
« Válasz #5 Dátum: 2013. Április 15. - 19:55:35 »
0 Show voters
Nem jó.

Nem elérhető b1s

  • 2212
  • Faszidegbénulás
    • Profil megtekintése
MySql / PHP Gond
« Válasz #6 Dátum: 2013. Április 15. - 20:17:27 »
0 Show voters
<?php
    if($_GET[\"page\"] == \"onlinegame\")
    {
        $query = \"SELECT * FROM onlinegame\";
        $result = mysql_query($query);
       
        echo mysql_error();
       
        while($row = mysql_fetch_array($result))
        {
            $stat = $row[\'status\'];
            $score    = $row[\'score\'];
            $lastwinner = $row[\'lastwinner\'];
           
            $status = switch($stat)
            {
            case 0: echo \"<font color=\'red\'>Inaktív</font>\";
            case 1: echo \"<font color=\'green\'>Aktív</font>\";
            }
           
            echo\"
            <table>
                <tr>
                    <td>A játék jelenleg:</td>        <td>\";$status echo\"</td>
                </tr>
                <tr>
                    <td>Megnyerhetõ pont:</td>        <td>$score</td>
                </tr>
                <tr>
                    <td>Utolsó nyertes:</td>        <td>$lastwinner</td>
                </tr>
            </table>\";
        }
    }
?>

 
Lehet nem jó.

Nem elérhető Live

  • 507
    • Profil megtekintése
MySql / PHP Gond
« Válasz #7 Dátum: 2013. Április 15. - 20:20:57 »
0 Show voters
Idézetet írta: KROOK date=1366049847\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"36192\" data-ipsquote-contentclass=\"forums_Topic

<?php
    if($_GET[\"page\"] == \"onlinegame\")
    {
        $query = \"SELECT * FROM onlinegame\";
        $result = mysql_query($query);
       
        echo mysql_error();
       
        while($row = mysql_fetch_array($result))
        {
            $stat = $row[\'status\'];
            $score    = $row[\'score\'];
            $lastwinner = $row[\'lastwinner\'];
           
            $status = switch($stat)
            {
            case 0: echo \"<font color=\'red\'>Inaktív</font>\";
            case 1: echo \"<font color=\'green\'>Aktív</font>\";
            }
           
            echo\"
            <table>
                <tr>
                    <td>A játék jelenleg:</td>        <td>\";$status echo\"</td>
                </tr>
                <tr>
                    <td>Megnyerhetõ pont:</td>        <td>$score</td>
                </tr>
                <tr>
                    <td>Utolsó nyertes:</td>        <td>$lastwinner</td>
                </tr>
            </table>\";
        }
    }
?>

 
Lehet nem jó.
 
Hát nem, de köszi hogy megpróbáltál segíteni :)

Nem elérhető Norby

  • 1575
    • Profil megtekintése
MySql / PHP Gond
« Válasz #8 Dátum: 2013. Április 16. - 21:40:51 »
0 Show voters
Amúgy a page megkapja az onlinegame értéket vagy a többit ki írja csak amit lekérdezel az a rossz?

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal