Ver Mensaje Individual
  #18 (permalink)  
Antiguo 21/10/2012, 07:13
pepe7000
 
Fecha de Ingreso: diciembre-2009
Mensajes: 36
Antigüedad: 14 años, 4 meses
Puntos: 1
Respuesta: Base de datos para galeria fotográfica

Sigo sin conseguir nada, y yo creo que ya arregle todo.
Código PHP:
<?
$link 
mysql_connect("localhost""root"); 
mysql_select_db("gallery_mysql"$link); 
$result mysql_query("
SELECT `photo`.`name`, `gallery`.`titulo_gal`
FROM `gallery`
LEFT JOIN `gallery_mysql`.`photo` ON `gallery`.`id_gal` = `photo`.`id_gal` "
$link);
while(
$row mysql_fetch_assoc($result)) {
$enlace "gallery.php?gallery={$row['titulo_gal']}";
$imagen "ruta/{$row['name']}";
echo 
"<a href=\"$enlace\"></a> <img src=\"$imagen\"/>";
}  
?>
Código PHP:
<?
$gallery 
= (isset($_GET['gallery'])) ? (int) $_GET['gallery'] : 0;
$sql "SELECT * FROM gallery WHERE id_gal = $gallery";
$result2 mysql_num_rows($sql);
while(
$row mysql_fetch_assoc($result2)) {
$titulo $row['titulo_gal'];
$descripcion $row['des_gal'];
}
$result3 mysql_query("
SELECT * FROM photo
WHERE gallery = $gallery"
$link);
while(
$row mysql_fetch_assoc($result3)) {
$enlace "photo.php?photo={$row['photo']}";
$imagen "ruta/{$row['name']}";
echo 
"<a href=\"$enlace\"></a> <img src=\"$imagen\"/>";
}  
?>
Código PHP:
<?
$link 
mysql_connect("localhost""root"); 
mysql_select_db("gallery_mysql"$link); 
$result mysql_query("
SELECT photo.* FROM photo
LEFT JOIN gallery ON photo.photo = gallery.id_gal"
$link);
while(
$row mysql_fetch_assoc($result)) {
$imagen $row['name'];
$titulo $row['titulo'];
$lugar $row['lugar'];
$descripcion $row['des_foto'];
echo 
"<img src=\"$imagen\"/>";
echo 
"$titulo";
echo 
"$lugar";
echo 
"$descripcion";
}  
?>
y durante la semana no tengo ni portatil ni internet para seguir peleandome
si vosotros veis lo que está mal decirmelo por favor, y yo el próximo fin de semana sigo en mi pequeña batalla.

Gracias por la ayuda y un saludo