Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/03/2003, 10:15
Avatar de kamezen
kamezen
 
Fecha de Ingreso: junio-2001
Ubicación: México, D.F.
Mensajes: 128
Antigüedad: 22 años, 10 meses
Puntos: 0
Este es el codigo...en el servidor de desarrollo funciona bien !!!! Los errores los marca en las funciones mysql_db_query y mysql_num_fields


Código PHP:
$Link mysql_connect($Host$User$Password);

$start 1;
$PaginationQuery "LIMIT " $start ", " $Pagesize;
$Query "No hay sentencia";

switch (
$vtipocon) {
     case 
1:
         if (
strlen($vnomautor) > strlen($vpatautor) == 0) {
             
$Query "SELECT cve_titulo as CLAVE, clasificacion, titulo, apellidos, nombres FROM $TableName where
         nombres like '%"
.$vnomautor."%'" $PaginationQuery;
     }
     if (
strlen($vnomautor) == strlen($vpatautor) > 0) {
             
$Query "SELECT cve_titulo as CLAVE, clasificacion, titulo, apellidos, nombres FROM $TableName where
         apellidos like '%"
.$vpatautor."%'" $PaginationQuery;
     }
     if (
strlen($vnomautor) > strlen($vpatautor) > 0) {
             
$Query "SELECT cve_titulo as CLAVE, clasificacion, titulo, apellidos, nombres FROM $TableName where
         (nombres like '%"
.$vnomautor."%' and apellidos like '%".$vpatautor."%')" $PaginationQuery;
     }

         break;
     case 
2:
         
$Query "SELECT cve_titulo as CLAVE, clasificacion, titulo, apellidos, nombres FROM $TableName where
               titulo like '%"
.$vtitulo."%'" $PaginationQuery;
     break;
     case 
3:
         
$Query "SELECT cve_titulo as CLAVE, clasificacion, titulo, apellidos, nombres FROM $TableName where
              temas like '%"
.$vtema."%'" $PaginationQuery;
     break;
 }

$TLinea 1;
$TCampo 1;
$Total 0;


$Result mysql_db_query ($DBName$Query$Link);

//pagination($start,$Link,$DBName,$TableName,$Pagesize);

// Create a table with headers.
print ("<center><TABLE BORDER=0 width=850 cellspacing=0 cellpading=5>\n");
print (
"<TR bgcolor=#339999>\n");
for (
$i 0$i mysql_num_fields($Result); $i++) {
    print 
"<TD><center><B>".mysql_field_name($Result$i)."</B></center></TD>\n";
}
print (
"</TR>\n");

$valor "PHP !!!";
// Fetch the results from the database.

while ($Row mysql_fetch_array ($Result)) {

      switch (
$TLinea) {
         case 
1:
              print (
"<TR>\n");
              for (
$i 0$i mysql_num_fields($Result); $i++) {
                   print 
"<TD>$Row[$i]</TD>\n";
              }
              print (
"</TR>\n");
              
$TLinea 2;
              
$Total $Total 1;
          break;
         case 
2:
              print (
"<TR bgcolor=#C4DFC9>\n");
              for (
$i 0$i mysql_num_fields($Result); $i++) {
                  print 
"<TD>$Row[$i]</TD>\n";
              }
              print (
"</TR>\n");
              
$TLinea 1;
          
$Total $Total 1;
          break;
      }

}
print (
"</TABLE></center>\n");

print 
"<table width=85% align=center>";
print 
"    <tr><td>";
print 
"        <hr align=left width=100% color=#9B4264>";
print 
"        No. de Registros -->".$Total;
print 
"    </td></tr>";
print 
"</table>";

mysql_close ($Link);

}}}
?> 
Saludos !!!

__________________
No esperes a que tu Nación haga algo por ti !!! Mejor haz primero algo por tu Nación !!!
México-WEB