Ver Mensaje Individual
  #13 (permalink)  
Antiguo 20/05/2014, 10:39
portal47
 
Fecha de Ingreso: abril-2014
Mensajes: 141
Antigüedad: 10 años
Puntos: 1
Respuesta: Actualizar varias tablas

este es mi conexion:

Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <title>Documento sin t&iacute;tulo</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. </head>
  6. <body>
  7.  
  8.  
  9. <?php
  10. function connectToDB( $dbName="" ) {
  11.    
  12.     $hostdb = 'localhost'; /*los datos son correctos   */
  13.     $userdb = 'root';  
  14.     $passdb = 'root';    
  15.     $namedb =  $dbName ? $dbName : 'movedb';
  16.  
  17.     $link = mysql_connect ($hostdb, $userdb, $passdb);
  18.        
  19.     if (!$link) {
  20.        die('Could not connect: ' . mysql_error());
  21.     }
  22.  
  23.     $db_selected = mysql_select_db($namedb);
  24.     if (!$db_selected) {
  25.         die ('Can\'t use database : ' . mysql_error());
  26.     }
  27.     return $link;
  28. }
  29.  
  30. ?>
  31.  
  32.  
  33. </body>
  34. </html>