Jonathan
12-15-2003, 07:40 PM
I need help with this script... It is just coming up blank or in 8 cells with only a 6 cell table...
You can see a working one here: http://www.crosspoint.org/delete/sermons.php
<?
include ('header.php');
?>
<table style="border:1px solid black;" width="760px" cellpadding="3">
<tr>
<td class="sermons" width="200px">
Title</td><td class="sermons" width="188px">
Date</td><td class="sermons" width="350px">
Passage</td><td class="sermons" width="22px">
Play</td>
</tr>
<tr>
<?
mysql_pconnect("$db_host","$db_username","$db_password") or die(mysql_error());
mysql_select_db("$update_db_name") or die(mysql_error());
$query = mysql_query("select * from sermons order by date desc limit 15") or die(mysql_error());
$check = mysql_num_rows($query);
if($check == 0){
echo "<td class=\"sub_sermon_odd\" colspan=\"4\" align=center>No recorded sermons at this time</td>";
exit();
}
while ($row = mysql_fetch_array($query)){
echo "<td class=\"".$td_type."\">" . $row['title'] . "</td>";
echo "<td class=\"".$td_type."\">" . $row['date'] . "</td>";
echo "<td class=\"".$td_type."\">" . $row['passage'] . "</td>";
echo "<td class=\"".$td_type."\"><a href=\"" . $row['link'] . "\"><img src=\"images/play_button.png\" border=0></a></td>";
}
?>
You can see a working one here: http://www.crosspoint.org/delete/sermons.php
<?
include ('header.php');
?>
<table style="border:1px solid black;" width="760px" cellpadding="3">
<tr>
<td class="sermons" width="200px">
Title</td><td class="sermons" width="188px">
Date</td><td class="sermons" width="350px">
Passage</td><td class="sermons" width="22px">
Play</td>
</tr>
<tr>
<?
mysql_pconnect("$db_host","$db_username","$db_password") or die(mysql_error());
mysql_select_db("$update_db_name") or die(mysql_error());
$query = mysql_query("select * from sermons order by date desc limit 15") or die(mysql_error());
$check = mysql_num_rows($query);
if($check == 0){
echo "<td class=\"sub_sermon_odd\" colspan=\"4\" align=center>No recorded sermons at this time</td>";
exit();
}
while ($row = mysql_fetch_array($query)){
echo "<td class=\"".$td_type."\">" . $row['title'] . "</td>";
echo "<td class=\"".$td_type."\">" . $row['date'] . "</td>";
echo "<td class=\"".$td_type."\">" . $row['passage'] . "</td>";
echo "<td class=\"".$td_type."\"><a href=\"" . $row['link'] . "\"><img src=\"images/play_button.png\" border=0></a></td>";
}
?>