Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/08/2006, 12:56
Avatar de DarkXNightmare
DarkXNightmare
 
Fecha de Ingreso: agosto-2005
Ubicación: Somewhere Over The Rainbo
Mensajes: 181
Antigüedad: 18 años, 8 meses
Puntos: 0
:D:D:D! Ya aprendí como crear las consultas SQL con LIMIT a ODBC. Ojo con este Script...

Código PHP:
<?php
$conn 
odbc_connect("mybase""xxxxx""xxxxx");
$sql "SELECT * FROM clients";
if (
preg_match("/LIMIT/"$sql))
{
    
preg_match("/^SELECT(.*?)(LIMIT ([0-9]+)[, ]*([0-9]+)*)?$/"$sql$limits);
    
$result odbc_exec($conn"SELECT" $limits[1]);
    
    
$show $limits[4] + $limits[3];
    
$limits[3]++;
    
    for (
$i $limits[3]; $i <= $show$i++)
    {
        
$row odbc_fetch_array($result$i);
        echo 
$row['nombre'] . "<br />\r\n";
    }    
}else{
    
$result odbc_exec($conn$sql);
    while (
$row odbc_fetch_array($result))
    {
        echo 
$row['nombre'] . "<br />\r\n";
    }
}
odbc_close($conn);
Ese es el Script y me funciona de maravilla ;D...
Espero que les ayude este Script a los que tienen mi duda ;)...
Atte... DarkXNightmare
__________________
Cambiando mi Web... sean pacientes :P