Visualizzazione risultati 1 fino 14 di 14

Discussione: Aggiornare la Client API version

  1. #1
    Guest

    Predefinito Aggiornare la Client API version

    Ma perche' non aggiornate la Client API version ,

    questa attuale e vecchia e da dei problemi con la comunicazione con il database MySQL!

  2. #2
    Ospite Guest

    Predefinito

    cioè? che tipo di problemi da? aggiornate chi?

  3. #3
    L'avatar di Evcz
    Evcz non è connesso Utente storico
    Data registrazione
    31-05-2002
    Residenza
    Vicenza
    Messaggi
    5,670

    Predefinito

    che problemi riscontri?

    la versione attualmente sui servers è quella che viene distrubita con php serie 4.3.x....

    la nuova versione rilasciata qualche settimana fa è disponibile solo a partire da php 4.4.x...

    che problemi riscontri con mysql????
    There are three kinds of people in this world: people who watch things happen ... people who complain about things that happen ... and people who make things happen...

  4. #4
    Guest

  5. #5
    Ospite Guest

    Predefinito

    ma per le lettere accentate? io tempo fa avevo avuto problemi nelle gd invece per le lettere accentate

  6. #6
    Guest

    Predefinito

    allora cerco di spiegare l'accaduto:

    ho spostato il mio sito da Lycos a Altervista, ed come dataabse uso db4free.org

    il problema che MySQL 5 e le API 3.4x non vanno tanto d'accordo...

    infatti ho impostato la charset del database su latin1, mentre richiamando la funzione mysql_fetch_array mi vedeva i caratteri come utf8 ;(

    Quindi sbagliava tutti i caratteri accentati.

  7. #7
    Guest

    Talking

    su db4free.org mi hanno detto che un database mysql5 richiede la api v4.1

    ho modificato il files mysql.php del phpnuke aggiungendo uft8_decode() ed adesso sembra momentaneamente corretto.


    Codice:
    function sql_fetchrow($query_id = 0)
    	{
    		if(!$query_id)
    		{
    			$query_id = $this->query_result;
    		}
    		if($query_id)
    		{
             $string = mysql_fetch_array($query_id);
             if (is_string($string)) {
              $string = utf8_decode($string);
             } elseif (is_array($string)) {
              reset($string);
              while (list($key, $value) = each($string)) {
               $string[$key] = utf8_decode($value);
              }
             }
    		 $this->row[$query_id] = $string;
             return $this->row[$query_id];
    		}
    		else
    		{
    			return false;
    		}
    	}
    questo pero' e un sotterfugio per nascondere il problema....

  8. #8
    L'avatar di Evcz
    Evcz non è connesso Utente storico
    Data registrazione
    31-05-2002
    Residenza
    Vicenza
    Messaggi
    5,670

    Predefinito

    esatto....

    mysql_5 per funzionare correttamente richiede delle api diverse... è anche per quello che pochissimi providers sono passati al 5...

    pensa che se cerchi in questo forum quando c'è stato un tentativo di passare a mysql 4.1 sono usciti problemi e quindi si è tornati a mysql 4.0 :)
    There are three kinds of people in this world: people who watch things happen ... people who complain about things that happen ... and people who make things happen...

  9. #9
    Guest

    Predefinito

    ho risolto il problema completamente sia per OsCommerce modificando il files database.php:

    Codice:
    
      function isGreater41() {
       $string = (mysql_get_client_info() > "4.1") ? true : false;
       return $string;
      }
      function tep_db_fetch_array($db_query) {
        $string = mysql_fetch_array($db_query, MYSQL_ASSOC);
        if (! is_bool($string)) {
         if (! isGreater41()) {
          if (is_string($string)) {
            return utf8_decode($string);
          } elseif (is_array($string)) {
            reset($string);
            while (list($key, $value) = each($string)) {
              $string[$key] = utf8_decode($value);
            }
            return $string;
          } else {
            return $string;
          }
         } else {
           return $string;
         }
       }
      }
    
      function tep_db_input($string) {
        if (! isGreater41()) {
         return addslashes(utf8_encode($string));
        } else {
         return addslashes($string);
        }
      }
    Ed anche per il php nuke ho applicato questo fix, al interno di mysql.php:

    Codice:
    	function sql_fetchrow($query_id = 0)
    	{
    		if(!$query_id)
    		{
    			$query_id = $this->query_result;
    		}
    		if($query_id)
    		{
             $string = mysql_fetch_array($query_id);
    
             if (! ((mysql_get_client_info() > "4.1") ? true : false)) {
              if (is_string($string)) {
               $string = utf8_decode($string);
              } elseif (is_array($string)) {
               reset($string);
               while (list($key, $value) = each($string)) {
                $string[$key] = utf8_decode($value);
               }
              }
             }
             $this->row[$query_id] = $string;
             return $this->row[$query_id];
    		}
    		else
    		{
    			return false;
    		}
    	}

  10. #10
    L'avatar di Evcz
    Evcz non è connesso Utente storico
    Data registrazione
    31-05-2002
    Residenza
    Vicenza
    Messaggi
    5,670

    Predefinito

    ottima segnalazione ;)
    There are three kinds of people in this world: people who watch things happen ... people who complain about things that happen ... and people who make things happen...

  11. #11
    Guest

    Predefinito

    secondo voi.

    se prendo il database su Altervista, quali accorgimenti devo prendere per spostare i dati dal database con mysql_5 al vostro senza fare danni?

  12. #12
    L'avatar di Evcz
    Evcz non è connesso Utente storico
    Data registrazione
    31-05-2002
    Residenza
    Vicenza
    Messaggi
    5,670

    Predefinito

    in fase di importazione importali con il charset default...

    sweden_latin1 mi pare...

    controlla da phpmyadmin.
    There are three kinds of people in this world: people who watch things happen ... people who complain about things that happen ... and people who make things happen...

  13. #13
    Guest

    Predefinito

    infatti il database mysql_5 aveva impostato come default uft8_generic_ci

    ad quando ho caricato il backup sql mi ha 'danneggiato' tutte le lettere accentate...

    cmq adesso e unpostato su latin1_generic_ci

    quando lo trasferisco mettero' latin1_sweden

  14. #14
    L'avatar di Evcz
    Evcz non è connesso Utente storico
    Data registrazione
    31-05-2002
    Residenza
    Vicenza
    Messaggi
    5,670

    Predefinito

    generic penso sia comunque ok...

    lo sweden è il default di tutte le installazioni normali... non so perchè... forse gli sviluppatori di mysql ab hanno un debole per le svedesi? :D

    l'importante è che ci sia il latin :)

    utf8 non è uno standard... è un tipo di codifica ad 8bit che però ognuno interpreta come vuole :/
    There are three kinds of people in this world: people who watch things happen ... people who complain about things that happen ... and people who make things happen...

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •