Problema afisare date

Discutii despre script-uri si coduri PHP-MySQL, precum si lucru cu XML in PHP.
claUdiu
Mesaje:313

Problema afisare date

AM si eu o problema cu afisarea datelor. Am urmatorul cod:

Cod: Selectaţi tot

<META name="rating" content="General">
<META name="language" content="english, EN">
<META name="distribution" content="Global">
<META name="robots" content="INDEX,FOLLOW">
<META name="revisit-after" content="1 Day">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
a:link {color:#1E6E9C; text-decoration:none}
a:visited {color:#1E6E9C; text-decoration:none}
a:hover {color:#000000}
</style>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body bgcolor="#ffffff" topmargin="0" background="bg.png">
<table align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="padding-bottom: 10px;">
<tr>
<td valign="top" align="center">
<table vspace="0" width="760" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
	<tr>
		<td valign="top">
<?php
include("header.html");
?>
</td>
</tr>
</table>
<br />
<table width="750">
<tr>
<td width="750">
	<?php include('content_up_index.html') ?>
	</td>
	</tr>
	</table>
	
<table width="100%" cellpadding="0" cellspacing="0" height="25">
	<tr>
		<td background="http://music-master.org/pic/styles/new/images/colhead.png" align="left" height="25">
			<font color="#ffffff" size="2"><b><center>Ultimele 30 de melodii adaugate pe site</center></b></font>
		</td>
	</tr>
</table>

		

<?php

echo '<table width="100%" cellpadding="1" cellspacing="1">';

echo '<tr>
		<td align="center" width="35" height="20" bgcolor="#7D0552">
			<font color="#ffffff" size="1"><b>Nr.</b></font>
		</td>
		<td align="left" width="570" height="20" bgcolor="#7D0552">
			<font color="#ffffff" size="1"><b>Numele melodiei</b></font>
		</td>
		<td width="120" height="20" align="center" bgcolor="#7D0552">
			<font color="#ffffff" size="1"><b>Data adaugarii</b></font>
		</td>
		<td align="center" width="35" height="20" bgcolor="#7D0552">
			<font color="#ffffff" size="1"><b>Hits</b></font>	
		</td>
	</tr>	';

$conn = mysql_connect("localhost", "stiumuzicaa", "stiumuzicaa")
    or die("Unable to connect to MySQL");
$selectdb = mysql_select_db('stiumuzicaa'); 
$interogare = "SELECT `titlu`, `hits` FROM `melodie`";
$rezultat = mysql_query($interogare);
if (mysql_errno()) {
    echo "<br />". mysql_errno(). " : ". mysql_error(). "<br />";
}
$nr_campuri = mysql_num_fields($rezultat);
if (mysql_num_rows($rezultat) == 0) {
    echo '0 rezultate';
}
else {
while ($rand = mysql_fetch_assoc($rezultat)) {

echo '<tr>
			<td align="center" width="35" height="20" bgcolor="#7D0552">
			<font color="#FDEEF4" size="1"><b></b></font>
		</td>
		<td align="left" width="430" height="20" bgcolor="#7D0552">
			<font size="1"><b><a class="link_mel" href="'.$rand['link'].'">'.$rand['titlu'].'</a></b></font>
		</td>
		<td width="140" height="20" align="center" bgcolor="#7D0552">
			<font color="#FDEEF4" size="1"><b>'.$rand['data_ad'].'<font color="#f59518"></font></b></font>
		</td>
		<td align="center" width="35" height="20" bgcolor="#7D0552">
			<font color="#FDEEF4" size="1"><b>'.$rand['hits'].'</b></font>	
		</td>
		</tr>
		
';
echo '</table>';
echo '<br>';
  }
}
?>
	<table width="100%" cellpadding="0" cellspacing="0" height="25">
	<tr>

			<bhr>
		</td>
	</tr>
</table>
<table style="border:1px solid #7D0552" width="922">
<tr>
<td width="750">
	<?php
		include("content_down_index.html");
	?>
</td>
</tr>
</table>	
</td>
<?php 
include("footer.html");
?>	
</body>
</html>
Problema e cand afiseaza datele nu mile afiseaza in tabel, mile afiseaza ca in poza de mai jos:

Aici e imaginea


Cum pot sa fac sa arate in tabel toate melodiile ???pls help, thxx
Se spune ca...."omul tot invata in viata". Dar...Totusi...Trebie sa ne oprim undeva, nu?

trif Mesaje:500
incerc si eu sa te ajut, m-am uitat peste cod si am vaz asta

Cod: Selectaţi tot

 <table width="100%" cellpadding="0" cellspacing="0" height="25">
   <tr>
         <bhr>
      </td>
   </tr>
</table>
nu este deschis ci numai inchis </td> si <bhr> nu stiu ce inseamna cred ca ar trebui sa fie<br>.
ai deschis tabel
echo '<table width="100%" cellpadding="1" cellspacing="1">';
echo '<tr>
<td align="center" width="35" height="20" bgcolor="#7D0552">
<font color="#ffffff" size="1"><b>Nr.</b></font>
</td>
<td align="left" width="570" height="20" bgcolor="#7D0552">
<font color="#ffffff" size="1"><b>Numele melodiei</b></font>
</td>
<td width="120" height="20" align="center" bgcolor="#7D0552">
<font color="#ffffff" size="1"><b>Data adaugarii</b></font>
</td>
<td align="center" width="35" height="20" bgcolor="#7D0552">
<font color="#ffffff" size="1"><b>Hits</b></font>
</td>
</tr>
';
$conn =....
echo '<tr> <--aici ai deschis iara dar nu stiu de ce
<td align="center" width="35" height="20" bgcolor="#7D0552">
<font color="#FDEEF4" size="1"><b></b></font>
</td>
<td align="left" width="430" height="20" bgcolor="#7D0552">
<font size="1"><b><a class="link_mel" href="'.$rand['link'].'">'.$rand['titlu'].'</a></b></font>
</td>
<td width="140" height="20" align="center" bgcolor="#7D0552">
<font color="#FDEEF4" size="1"><b>'.$rand['data_ad'].'<font color="#f59518"></font></b></font>
</td>
<td align="center" width="35" height="20" bgcolor="#7D0552">
<font color="#FDEEF4" size="1"><b>'.$rand['hits'].'</b></font>
</td>
</tr><-- aici l-ai inchis dar trebuie sa fie tabel inainte
';
echo '</table>';<-- si aici ai inchis primul tabel
...
incerca sa elimini <tr> si </tr>. sper ca asta este. cu stima trif
M-am hotarat!
De ce sa fiu trist?
Oricum nu intereseaza pe nimeni...!
Mai bine sunt fericit si ii enervez pe toti cu fericirea mea!
http://www.cantaricrestine.ro
---> cu stima Trif

Subiecte similare