Foros del Web » Programando para Internet » PHP »

No muestra algunos caracteres

Estas en el tema de No muestra algunos caracteres en el foro de PHP en Foros del Web. Hola lo que pasa es lo siguiente tengo un script de un Autocompletado lo descarge de la pagina de robosomatic todo funciona bien pero cuando ...
  #1 (permalink)  
Antiguo 12/09/2008, 17:50
 
Fecha de Ingreso: abril-2006
Mensajes: 134
Antigüedad: 18 años
Puntos: 0
No muestra algunos caracteres

Hola lo que pasa es lo siguiente tengo un script de un Autocompletado lo descarge de la pagina de robosomatic todo funciona bien pero cuando el autocompletado si en mi btabla hay caracteres como una ñ, pone un signo de interrogacion, cabe mencionar que en mi base de datos si acepta bien la ñ, no encuentro ningun problema y no se que esta pasando espero me puedan ayudar el script que hace la consulta es el siguiente:

Código PHP:

// PHP5 Implementation - uses MySQLi.
    // mysqli('localhost', 'yourUsername', 'yourPassword', 'yourDatabase');
    
$db = new mysqli('localhost''xxx' ,'xxx''base');
    
    if(!
$db) {
        
// Show error if we cannot connect.
        
echo 'ERROR: Could not connect to the database.';
    } else {
        
// Is there a posted query string?
        
if(isset($_POST['queryString'])) {
            
$queryString $db->real_escape_string($_POST['queryString']);
            
            
// Is the string length greater than 0?
            
            
if(strlen($queryString) >0) {
                
// Run the query: We use LIKE '$queryString%'
                // The percentage sign is a wild-card, in my example of countries it works like this...
                // $queryString = 'Uni';
                // Returned data = 'United States, United Kindom';
                
                // YOU NEED TO ALTER THE QUERY TO MATCH YOUR DATABASE.
                // eg: SELECT yourColumnName FROM yourTable WHERE yourColumnName LIKE '$queryString%' LIMIT 10
                
                
$query $db->query("SELECT ID,R_Social FROM clientes WHERE R_Social LIKE '$queryString%' LIMIT 10");
                if(
$query) {
                    
// While there are results loop through them - fetching an Object (i like PHP5 btw!).
                    
while ($result $query ->fetch_object()) {
                        
// Format the results, im using <li> for the list, you can change it.
                        // The onClick function fills the textbox with the result.
                        
                        // YOU MUST CHANGE: $result->value to $result->your_colum
                         
echo '<a href="SD.php?IDC='.$result->ID.'&RS='.$result->R_Social.'"><li onClick="fill(\''.$result->R_Social.'\');">'.$result->R_Social.'</li></a>';
                     }
                } else {
                    echo 
'ERROR: There was a problem with the query.';
                }
            } else {
                
// Dont do anything.
            
// There is a queryString.
        
} else {
            echo 
'There should be no direct access to this script!';
        }
    } 
Que creen que pueda ser???
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:01.