Ver Mensaje Individual
  #21 (permalink)  
Antiguo 22/04/2008, 13:53
daniguillamon
 
Fecha de Ingreso: febrero-2006
Ubicación: Cartagena (Murcia)
Mensajes: 34
Antigüedad: 18 años, 3 meses
Puntos: 0
Re: Consultar varias bases de datos para una sola web

Lo he puesto así y no funciona

Código PHP:
<?php
function connectarbd ()
{
    
//Connexió local:    
    
$conex=mysql_connect ('localhost''usuario''pass') or die ("No puedo conectar con el server");
    if(!
mysql_selectdb ('base_datos')) die ("no se puede abrir la BD");
    return 
$conex;
}
?>

Código PHP:
<?php
include_once 'bd.php'
?>

<style type="text/css">
<!--
.Estilo1 {color: #333333}
-->
</style>
    <table border="0" cellspacing="0" cellpadding="5" width="100%" style="border-left: 1px solid #c7c6c5; border-right: 1px solid #c7c6c5; border-bottom: 1px solid #c7c6c5;">
      <!--DWLayoutTable-->
      <tr><td colspan="3" background="imagenes/fondoverdeenca.gif" style="border-bottom: 1px solid #e9e9e9; color:#ffffff;"><b>ÚLTIMOS JUEGOS AÑADIDOS</b></td>

      </tr>


<?php

$connexion
=connectarbd();  //conectas a la BD 1
$consulta=" SELECT id,title,section FROM sp_games WHERE published = '1' ORDER BY id DESC";
$resultat=mysql_query($consulta);
while(
$fila=mysql_fetch_array($resultat))
{
       
//Codigo que necesites
       
$bgcolor = ($bgcolor == "#ffffff" "#e9e9e9" "#ffffff");
       echo 
'<div style="padding: 3px; background: ' $bgcolor ';">';
       echo 
$sections["$fila['section']"];
       echo 
': <a href="gamedetails.php?id='.$fila['id'].'">'.stripslashes($fila['title']).'</a>';
       echo 
'</div>';
}

 
mysql_close($connexion);//cierras la conexion a la BD 
?>

   <tr>
      <td height="0" colspan="2" bgcolor="#ebebeb" style="padding: 3px;">
    <div style="padding: 3px; text-align: center;">
        <a href="games.php">Ver Juegos</a> |
        <a href="search.php">Buscar juegos</a>  </div>      </td>

   </tr>
   

</table>
y de alguna otra forma

el error que me aparece es:
Código PHP:
Parse errorsyntax errorunexpected T_ENCAPSED_AND_WHITESPACEexpecting T_STRING or T_VARIABLE or T_NUM_STRING in C:AppServwwwcodigos_phpjuegos22.php on line 36 
asi que nada, no me aclaro, como no lo expliques para tontos...