formatting problems:
| From: | Ryan A | Date: | Tue, 16 Aug 2005 20:04:10 +0000 |
| Subject: | formatting problems: | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-220718@lists.php.net to get a copy of this message | ||
Hi,
My database has a table called movies which has data like this:
flick_name ,flick_cover, part_url
flick_name is the name of the movie, the movie is cut into several pieces
for faster downloads
part_url is the full path to each of the pieces
eg:
home movie 1 ,a.gif, http://movieserver.com/scene1_1.wmv
home movie 1 ,a.gif, http://movieserver.com/scene1_2.wmv
home movie 1 ,a.gif, http://movieserver.com/scene1_3.wmv
home movie 1 ,a.gif, http://movieserver.com/scene2_1.wmv
home movie 1 ,a.gif, http://movieserver.com/scene2_2.wmv
home movie 1 ,a.gif, http://movieserver.com/scene2_3.wmv
etc
I am trying to get it into this format:
http://www.ezee.se/format.jpg
The main problem I am having is that I cannot seem to get the part files to
properly repeat inside the
table....
one idea I came up with is to have a nested table for the part files....but
even that is not working...I am getting
all screwed up tables...
Below is the exact code I have screwed around with, its a bit different coz
i tried to simplify my problem when
writing to the list...dont know if it helps but have a look at my code if
you need to...
Thanks in advance,
Ryan
<?php
$hostt="localhost";
$userr="";
$passs="";
$db="movies";
$connected=mysql_connect("$hostt", "$userr", "$passs") or die ('I
cannot
connect to the database because: ' . mysql_error());
mysql_select_db ("$db");
$q=mysql_query("select * from csv_28814");
$num_rows = mysql_num_rows($q);
$flick_name2="";
$once=0;
for($i=0; $i < $num_rows; $i++)
{
$row = mysql_fetch_row($q);
$flick_name = $row[0];
$part_url = $row[1];
$part_size = $row[2];
$time_length = $row[3];
$part_format = $row[4];
if($flick_name != $flick_name2)
{
echo "<table width='80%' bgcolor=gray border='0'
cellspacing='0'
cellpadding='0'>
<tr>
<td colspan='2'><strong><font
size='+1'>Title</font></strong></td>
<td width='40%'> </td>
</tr>
<tr>
<td width='22%' align='center' valign='middle'>cover pic
</td>
<td colspan='2' nowrap><table width='100%' border='0'
cellspacing='0'
cellpadding='0'>
<tr>
<td width='81%'><strong>Scenes</strong></td>
<td width='10%'><strong>Length</strong></td>
<td width='9%'><strong>Format</strong></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table><br>\n\n\n\n\n\n\n\n\n";
}
$flick_name2 = $flick_name;
}
?>