Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/01/2011, 08:02
Avatar de Nano_
Nano_
 
Fecha de Ingreso: febrero-2006
Ubicación: Bogotá, Colombia
Mensajes: 1.866
Antigüedad: 18 años, 2 meses
Puntos: 96
Respuesta: Contar registros totales de todas las db

Saludos

Has intentado realizarlo por separado?

Código PHP:
Ver original
  1. $sql_world1=mysql_query("SELECT COUNT(*) as total FROM world1.online") or die (mysql_error());
  2. $row_world1=mysql_fetch_array($sql_world1);
  3. $total1=$row_world1['total'];
  4. $sql_world2=mysql_query("SELECT COUNT(*) as total FROM world2.online") or die (mysql_error());
  5. $row_world2=mysql_fetch_array($sql_world2);
  6. $total2=$row_world2['total'];
  7.  
  8.  
  9. $sql_world3=mysql_query("SELECT COUNT(*) as total FROM world3.online") or die (mysql_error());
  10. $row_world3=mysql_fetch_array($sql_world3);
  11. $total3=$row_world3['total'];
  12.  
  13. $totalGeneral=$total1+$total2+$total3;
__________________
:.:Nano.:: @nano_hard - Retornando al foro