Hallo,
ich bin ein Anfänger in php und mySQL und habe folgendes Problem und bin schon am Verzweifeln!!!!
1) meine DB spuckt nicht alle Daten aus der DB, liegt dies an meiner while-Schleife????
2) Ich möchte alle Daten ab dem heutigen Zeitpunkt sehen (hat was mit timestamp zu tun???)
Wie bekomme ich das denn hin????
Vielen Dank!!!!
ich bin ein Anfänger in php und mySQL und habe folgendes Problem und bin schon am Verzweifeln!!!!
1) meine DB spuckt nicht alle Daten aus der DB, liegt dies an meiner while-Schleife????
PHP-Code:
<?php
require_once "grab_globals.inc.php";
include "config.inc.php";
include "functions.inc";
include "$dbsys.inc";
$sql = "SELECT start_time, end_time, (end_time - start_time), $tbl_entry.firma, $tbl_entry.contact, $tbl_entry.description, name, $tbl_room.room_name, $tbl_entry.catering_index, $tbl_entry.drive FROM $tbl_entry, $tbl_room WHERE $tbl_entry.room_id = $tbl_room.id ";
$res = sql_query($sql);
if (! $res) fatal_error(0, sql_error());
$row_count = 0;
while($row=mysql_fetch_array($res))
{
if( $enable_periods )
list( $start_period, $start_date) = period_date_string($row[0]);
else
$start_date = time_date_string($row[0]);
if( $enable_periods )
list( , $end_date) = period_date_string($row[1], -1);
else
$end_date = time_date_string($row[1]);
$duration = $row[2] - cross_dst($row[0], $row[1]);
$firma = htmlspecialchars($row[3]);
$description = htmlspecialchars($row[4]);
$contact = htmlspecialchars($row[5]);
$name = htmlspecialchars($row[6]);
$room = htmlspecialchars($row[7]);
$catering_index = htmlspecialchars($row[8]);
$drive = htmlspecialchars($row[9]);
$row_count++;
}
$enable_periods ? toPeriodString($start_period, $duration, $dur_units) : toTimeString($duration, $dur_units);
?>
<h3><?php echo get_vocab("visitor") ?></h3>
<table class="mrbs_visitors" border="1" cellpadding="0" cellspacing="0" style="width:100%; vertical-align:top;text-align:center; background-color:none; padding:5px;">
<tr>
<td style="width:130px;white-space:nowrap;text-align:center;"><?php echo get_vocab("start_date") ?></td>
<td style="width:130px;white-space:nowrap;text-align:center;"><?php echo get_vocab("end_date") ?></td>
<td style="width:100px;text-align:center;"><?php echo get_vocab("duration") ?></td>
<td style="width:130px;text-align:center;"><?php echo get_vocab("firma") ?></td>
<td style="width:130px;text-align:center;"><?php echo get_vocab("description") ?></td>
<TD CLASS=CR style="width:230px; white-space:nowrap; text-align:center;"><?php echo get_vocab("contact")?></TD>
<TD CLASS=CR style="width:130px;text-align:center;"><?php echo get_vocab("namebooker")?></TD>
<TD CLASS=CR style="width:130px;text-align:center;"><?php echo get_vocab("room")?></TD>
<TD CLASS=CR style="width:90px;text-align:center;"><?php echo get_vocab("catering_index")?></TD>
<TD CLASS=CR style="width:90px;text-align:center;"><?php echo get_vocab("drive")?></TD>
</tr>
<tr>
<td><?php echo $start_date ?></td>
<td><?php echo $end_date ?></td>
<td><?php echo $duration . " " . $dur_units ?></td>
<td><?php echo nl2br($firma) ?></td>
<td><?php echo nl2br($contact) ?></td>
<td><?php echo nl2br($description) ?></td>
<td><?php echo nl2br($name) ?></td>
<td><?php echo nl2br($room) ?></td>
<td><?php
if ($catering_index == 0)
{ echo get_vocab("catering_index_0"); }
elseif ($catering_index == 1)
{ echo get_vocab("catering_index_1"); }
elseif ($catering_index == 2)
{ echo 'Erweiterte Bewirtung'; }
?></td>
<td><?php
if($drive == 0) {
echo get_vocab("NO") ;
} else { echo get_vocab("YES");
} ?></td>
</tr>
</table>
<BR>
<?php if (isset($HTTP_REFERER)) //remove the link if displayed from an email
{ ?>
<a href="<?php echo $HTTP_REFERER ?>"><?php echo get_vocab("returnprev") ?></a>
<?php
}
include "trailer.inc"; ?>
Wie bekomme ich das denn hin????
Vielen Dank!!!!
Kommentar