Visualizzazione dei risultati da 1 a 4 su 4

Discussione: Ne crea solo una...

  1. #1

    Ne crea solo una...

    Ho scritto questo codice:
    Codice PHP:
    <?PHP
    include("../connessionedatabase.inc.php"); //SI CONNETTE AL DATABASE

    $querytbu "CREATE TABLE utenti (
    id INT (4) UNSIGNED not null AUTO_INCREMENT,
    username TEXT (10) not null,
    password TEXT (15) not null, 
    data INT(11),
    viveri INT (15),
    olio INT (15),
    metallo INT (15),
    idrogeno INT (15),
    ossigeno INT (15),
    polverestellare INT (15),
    uranio INT (15),
    contanti INT (15),
    PRIMARY KEY (id))"
    ;

    if (
    mysql_query($querytbu$db))
    echo 
    "<font color=green>L'installazione 1 è stata eseguita correttamente</font>
    "
    ;
    else
    echo 
    "[b]<font color=red>Errore durante l'installazione 1</font>[/b]
    "
    ;

    //PIANETI

    $querytbp "CREATE TABLE pianeti (
    id INT (6) UNSIGNED not null AUTO_INCREMENT,
    assex INT (6) UNSIGNED not null AUTO_INCREMENT,
    assey INT (6) UNSIGNED not null AUTO_INCREMENT,
    temperatura INT (6),
    nome TEXT (10),
    possessore INT (4),
    viveri INT (6),
    olio INT (6),
    metallo INT (6),
    idrogeno INT (6),
    ossigeno INT (6),
    polverestellare INT (6),
    uranio INT (6),
    PRIMARY KEY (id))"
    ;



    if (
    mysql_query($querytbp$db))
    echo 
    "<font color=green>L'installazione 2 è stata eseguita correttamente</font>";
    else
    echo 
    "[b]<font color=red>Errore durante l'installazione 2</font>[/b]";



    ?>

    Ma quando lo eseguo solo la prima creazione di tabella mi va a buon fine, perchè? cosa sbaglio? Grazie, Piero
    http://qzit.altervista.org

  2. #2
    metti un
    echo mysql_error();
    in fondo, così vedi l'errore che ti da

  3. #3
    Utente di HTML.it L'avatar di neida
    Registrato dal
    Feb 2005
    Messaggi
    1,478
    "AUTO_INCREMENT" ... ma quanti ne hai usati?

  4. #4
    graziess.... era proprio quello!
    http://qzit.altervista.org

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.