Ver Mensaje Individual
  #7 (permalink)  
Antiguo 29/03/2012, 14:29
ensija
 
Fecha de Ingreso: septiembre-2010
Ubicación: Berga
Mensajes: 6
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: saltos de linea en una base de datos phpMyAdmin

de momento tengo dos paginas,el listado y el detalle,esta es el detalle.

<?php require_once('Connections/coleccioncnn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_coleccioncnn, $coleccioncnn);
$query_detall = "SELECT * FROM discos";
$detall = mysql_query($query_detall, $coleccioncnn) or die(mysql_error());
$row_detall = mysql_fetch_assoc($detall);
$totalRows_detall = mysql_num_rows($detall);$colname_detall = "-1";
if (isset($_GET['discid'])) {
$colname_detall = $_GET['discid'];
}
mysql_select_db($database_coleccioncnn, $coleccioncnn);
$query_detall = sprintf("SELECT * FROM discos WHERE discid = %s", GetSQLValueString($colname_detall, "int"));
$detall = mysql_query($query_detall, $coleccioncnn) or die(mysql_error());
$row_detall = mysql_fetch_assoc($detall);
$totalRows_detall = mysql_num_rows($detall);

mysql_select_db($database_coleccioncnn, $coleccioncnn);
$query_bandas = "SELECT * FROM bandas";
$bandas = mysql_query($query_bandas, $coleccioncnn) or die(mysql_error());
$row_bandas = mysql_fetch_assoc($bandas);
$totalRows_bandas = mysql_num_rows($bandas);


$rs = mysql_query('SELECT bandas FROM tabla_bandas');
while ($row = mysql_fetch_array($rs))
{
echo '';
echo nl2br( $row["bandas"] );
echo '';
}

?>





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/probados.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>La Meva Col.leccio</title>
<!-- InstanceEndEditable -->
<link href="misestilos.css" rel="stylesheet" type="text/css" /><!--[if IE]>
<style type="text/css">
/* coloque las reparaciones de css para todas las versiones de IE en este comentario condicional */
.twoColElsLtHdr #sidebar1 { padding-top: 30px; }
.twoColElsLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* la propiedad zoom propia que se indica más arriba proporciona a IE el hasLayout que necesita para evitar diversos errores */
</style>
<![endif]-->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body class="twoColElsLtHdr">

<div id="container">
<div id="header">

<!-- end #header --></div>
<div class="inici"><p>Inici</p></div>
<div id="sidebar1">
<table width="100%" border="0" cellpadding="5">
<tr>
<th align="center" scope="col">Bandas</th>
</tr>
<tr>
<td align="center"><form id="form1" name="form1" method="get" action="resultat_bandas.php">
<p>
<label for="bandasid"></label>
<select name="bandasid" id="bandasid">
<?php
do {
?>
<option value="<?php echo $row_bandas['bandaid']?>"><?php echo utf8_encode($row_bandas['nombrebanda'])?></option>
<?php
} while ($row_bandas = mysql_fetch_assoc($bandas));
$rows = mysql_num_rows($bandas);
if($rows > 0) {
mysql_data_seek($bandas, 0);
$row_bandas = mysql_fetch_assoc($bandas);
}
?>
</select>
</p>
<p>
<label for="button"></label>
<input type="submit" name="button" id="button" value="Buscar Bandas" />
</p>
</form></td>
</tr>
<tr>
<td align="center"></td>
</tr>
<tr>
<td align="center"></td>
</tr>
<tr>
<td align="center"></td>
</tr>
<tr>
<td align="center"></td>
</tr>
<tr>
<td align="center">DVD</td>
</tr>
<tr>
<td><hr /></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<img class="foto" src="imagenes/fondo/dead-bridge-09.png" width="180" height="206" />
<!-- end #sidebar1 --></div>
<div id="mainContent"><!-- InstanceBeginEditable name="probados" -->
<h1> Rock Californià </h1>
<table width="100%" border="0" cellpadding="0">
<tr>
<th width="50%" rowspan="4" scope="col"><img src="imagenes/grans/<?php echo $row_detall['imatje']; ?>" /></th>
<th width="50%" scope="col"><?php echo utf8_encode($row_detall['nomdisc']); ?></th>
</tr>
<tr>
<td height="143"><?php echo utf8_encode( $row_detall['musics']); ?></td>
</tr>
<tr>
<td height="24"><hr /></td>
</tr>
<tr>
<td><?php echo utf8_encode($row_detall['temas']);


?>
</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
</table>
<p>&nbsp;</p>
<!-- InstanceEndEditable -->
<!-- end #mainContent --></div>
<!-- Este elemento de eliminación siempre debe ir inmediatamente después del div #mainContent para forzar al div #container a que contenga todos los elementos flotantes hijos --><br class="clearfloat" />
<div id="footer">
<p><a href="mailto:[email protected]">ensija@telefon ica.net</a></p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($detall);

mysql_free_result($bandas);
?>