Stránka 1 z 1

Error v mysql

Napsal: 02 srp 2011 15:10
od Grow
Obrázek

Zdravím, potřeboval bych se zbavit téhleté chyby, nevíte někdo jak to spravit?
Tady scripty
display.php

Kód: Vybrat vše

<?php

    // Send variables for the MySQL database class.
    $database = mysql_connect('localhost', 'grow', 'password') or die('Could not connect: ' . mysql_error());
    mysql_select_db('openfirescores') or die('Could not select database');

    $query = "SELECT * FROM `scores` ORDER by `score` DESC LIMIT 5";
    $result = mysql_query($query) or die('Query failed: ' . mysql_error());

    $num_results = mysql_num_rows($result);

    for($i = 0; $i < $num_results; $i++)
    {
         $row = mysql_fetch_array($result);
         echo $row['name'] . "\t" . $row['score'] . "\n";
    }
?>

addscore.php

Kód: Vybrat vše

<?php

        $db = mysql_connect('localhost', 'grow', 'password') or die('Could not connect: ' . mysql_error());
        mysql_select_db('openfirescores') or die('Could not select database');

        // Strings must be escaped to prevent SQL injection attack.
        $name = mysql_real_escape_string($_GET['name'], $db);
        $score = mysql_real_escape_string($_GET['score'], $db);
        $hash = $_GET['hash'];

        $secretKey="mySecretKey"; # Change this value to match the value stored in the client javascript below

        $real_hash = md5($name . $score . $secretKey);
        if($real_hash == $hash) {
            // Send variables for the MySQL database class.
            $query = "insert into scores values (NULL, '$name', '$score');";
            $result = mysql_query($query) or die('Query failed: ' . mysql_error());
        }
?>

Re: Error v mysql

Napsal: 02 srp 2011 15:19
od SimiX-[Poradím]
čus ja taki nevím dělá mi to uplně to samé ale používam mysql na svuj server mt2 :)

Re: Error v mysql

Napsal: 02 srp 2011 17:16
od Grow
Já to zas potřebuju na score do hry.

Re: Error v mysql

Napsal: 06 srp 2011 21:00
od CZechBoY
Simix: nespamuj, takhle mu poradíš leda kulový...

Grow: neinstaluje se náhodou nějak ten program/script?
chyba ti říká, že neexistuje sloupec `score` takže zkus přeinstalovat ten program/script nebo přidat sloupec `score` do tabulky `scores`