Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 14
  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    892

    problema con php e mysql

    Salve a tutti,

    seguendo anche il tutorial su HTML.IT ho installato Mysql sul mio pc per far girare in locale. Fin qui tutto ok.

    Se però provo ad effettuare una query mi stampa questo messaggio:

    codice:
    File 'c:\mysql\share\charsets\?.conf' not found (Errcode: 2) Character set '#33' is not a compiled character set and is not specified in the 'c:\mysql\share\charsets\Index' file
    non so come intervenire per risolvere il problema... la query poi la esegue, ma questo messaggio non riesco a toglierlo...

    inoltre mi stampa anche:

    codice:
    Notice: Undefined index: page in c:\inetpub\wwwroot\cdg\cdg\elencolog.php on line 28
    Dove devo intervenire per eliminare i notice???

    Grazie mille a chi vorrà aiutarmi,
    franz

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    892
    dimenticavo: la versione di php è la 4.4.4, quella di Mysql è la 5.0

  3. #3
    Apri il file di configurazione di php (php.ini) e cerchi questa parte:

    codice:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; error_reporting is a bit-field.  Or each number up to get desired error
    ; reporting level
    ; E_ALL             - All errors and warnings (doesn't include E_STRICT)
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_STRICT          - run-time notices, enable to have PHP suggest changes
    ;                     to your code which will ensure the best interoperability
    ;                     and forward compatibility of your code
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
    ; Examples:
    ;
    ;   - Show all errors, except for notices and coding standards warnings
    ;
    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ;   - Show all errors, except for notices
    ;
    ;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
    ;
    ;   - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
    ;
    ;   - Show all errors, except coding standards warnings
    ;
    error_reporting  =  E_ALL
    La parte in grassetto è la soluzione al tuo problema
    <!-- Debian GNU/Linux 4.0 Kernel 2.6.x -->
    ftp://ftp.it.debian.org/
    http://www.php.net/

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    892
    mi continua a dare lo stesso errore...
    adesso il php.ini è così:
    codice:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; error_reporting is a bit-field.  Or each number up to get desired error
    ; reporting level
    ; E_ALL             - All errors and warnings
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
    ; Examples:
    ;
    ;   - Show all errors, except for notices and coding standards warnings
    ;
    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ;   - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR

  5. #5
    Dov'è la parte che hai modificato?
    La modifica la devi fare in questo modo per far funzionare il tutto:
    codice:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; error_reporting is a bit-field.  Or each number up to get desired error
    ; reporting level
    ; E_ALL             - All errors and warnings (doesn't include E_STRICT)
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_STRICT          - run-time notices, enable to have PHP suggest changes
    ;                     to your code which will ensure the best interoperability
    ;                     and forward compatibility of your code
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
    ; Examples:
    ;
    ;   - Show all errors, except for notices and coding standards warnings
    ;
    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ;   - Show all errors, except for notices
    ;
    ;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
    ;
    ;   - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
    ;
    ;   - Show all errors, except coding standards warnings
    ;
    error_reporting  =  E_ALL & ~E_NOTICE
    Ricorda di riavviare apache dopo aver modificato e salvato il file php.ini
    <!-- Debian GNU/Linux 4.0 Kernel 2.6.x -->
    ftp://ftp.it.debian.org/
    http://www.php.net/

  6. #6
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    892
    in effetti il notice così scompare, ma mi resta il problema del charset... sembra non trovare un file...
    QUesto è l'errore:
    codice:
    File 'c:\mysql\share\charsets\?.conf' not found (Errcode: 2) Character set '#33' is not a compiled character set and is not specified in the 'c:\mysql\share\charsets\Index' file
    e questa è la parte del php.ini (ho usato un tool per l'installazione di php, e mi aha messo il php.ini nella directory C:\WINDOWS)

    codice:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; error_reporting is a bit-field.  Or each number up to get desired error
    ; reporting level
    ; E_ALL             - All errors and warnings
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
    ; Examples:
    ;
    ;   - Show all errors, except for notices and coding standards warnings
    ;
    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ;   - Show all errors, except for notices
    ;
    ;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
    ;
    ;   - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
    ;
    ;   - Show all errors, except coding standards warnings
    ;
    error_reporting  =  E_ALL & ~E_NOTICE
    AIUTO:::

  7. #7
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    892
    In effetti
    File 'c:\mysql\share\charsets\?.conf' not found
    non esiste... non c'è nessun file .conf: soltanto gli xml con i linguaggi e il readme...
    qualcuno mi sa dire come pooso fare?

  8. #8
    Puoi postare il codice SQL della query e lo script php con cui esegui l'interrogazione?
    <!-- Debian GNU/Linux 4.0 Kernel 2.6.x -->
    ftp://ftp.it.debian.org/
    http://www.php.net/

  9. #9
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    892
    certo:
    codice:
    <?
    // connessione al database
    mysql_connect($host, $user, $password) or die("Connessione fallita !");
    // selezione del DB
    mysql_select_db($database) or die("Selezione del DB fallita !");
    // esecuzione prima query
    $count = mysql_query("SELECT COUNT(id) FROM azioni");
    $res_count = mysql_fetch_row($count);
    // numero totale di records
    $tot_records = $res_count[0];
    // risultati per pagina(secondo parametro di LIMIT)
    $per_page = 10;
    // nuero totale di pagine
    $tot_pages = ceil($tot_records / $per_page);
    // pagina corrente
    $current_page = (!$_GET['page']) ? 1 : (int)$_GET['page'];
    // primo parametro di LIMIT
    $primo = ($current_page - 1) * $per_page;
    ?>
    <body>
    <table border="0" width="386" height="51" cellspacing="0" cellpadding="0">
        <tr>
          <td width="26" height="13" align="center"></td>
          <td width="86" align="center"><font face="Arial" size="1">Data</font></td>
          <td width="101" height="13" align="center"><font face="Arial" size="1">Utente</font></td>
          <td width="137" align="center"><font face="Arial" size="1">azione</font></td>
          <td width="36" height="13" align="center"><font face="Arial" size="1">[img]reload.jpg[/img]</font></td>
        </tr>
    <?
    // esecuzione seconda query con LIMIT
    $query_limit = mysql_query("SELECT utente, azione, DATE_FORMAT(orario,'%d/%m/%Y') as data FROM azioni ORDER BY id DESC LIMIT $primo, $per_page");
    while($results = mysql_fetch_array($query_limit))
     {
    ?>
        <tr>
     <td width="26" height="26"></td>
     <td width="86" align="center"><font face="Arial" size="1"><?print ($results['data']); ?></td>
     <td width="101" height="26" align="center"><font face="Arial" size=1><?print ($results['utente']); ?></td>
     <td width="137" align="center"><font face="Arial" size=1><?print ($results['azione']); ?></td>
     <td width="36" height="26">    
        </tr>
    <?
    }
    ?>
    </table>
    <?
    mysql_close();
    ?>
    Sai cosa? ho notato che sotto C:\ lui non mi ha creato nessuna cartela Mysql... quindi va a cercarmi un file dalla parte sbagliata!! Come mai?

  10. #10
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    892
    Nessuno sa darmi una mano???

    aiutatemi, ho poco tempo...


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.