Moin
bin leider erst jetzt wieder dazu gekommen.
Also irgendwie bekomme ich das noch ned so recht hin, er schreibt mir nun nur noch hin das nix eingetragen ist.
Hier mal das gesammte nochmal:
PHP-Code:
<?PHP
//########################### TOP ANGEBOTE DB ANFRAGE ANFANG ############################
error_reporting(8);
include("../config.php");
include("hotelid.php");
$db_con=mysql_connect($db_server, $db_user, $db_password) or die(mysql_error());
mysql_select_db($db_name) or die(mysql_error());
$angebote = "SELECT `sitedescription`,`expiredate`,`sitetitle` FROM `ad` WHERE `ad_username` = '$hotelid' ORDER BY `sitedate` ASC LIMIT 0, 30";
$result=mysql_query($angebote);
mysql_close($db_con);
//########################### TOP ANGEBOTE DB ANFRAGE ENDE ############################
?>
Das ist die Abfrage.
PHP-Code:
<!--//########################### TOP ANGEBOTE ANFANG ############################ -->
<table border="0" bordercolor="#000000"cellspacing="0" cellpadding="0" width="593">
<tr>
<td><IMG SRC="../../../images/blind.gif" WIDTH="150" HEIGHT="10"></td>
<td><IMG SRC="../../../images/blind.gif" WIDTH="15" HEIGHT="10"></td>
<td><IMG SRC="../../../images/blind.gif" WIDTH="90" HEIGHT="10"></td>
<td><IMG SRC="../../../images/blind.gif" WIDTH="15" HEIGHT="10"></td>
<td><IMG SRC="../../../images/blind.gif" WIDTH="308" HEIGHT="10"></td>
<td><IMG SRC="../../../images/blind.gif" WIDTH="15" HEIGHT="10"></td>
</tr>
<tr CLASS="menue">
<td> Titel</td>
<td><IMG SRC="../../../images/blind.gif" WIDTH="10" HEIGHT="10"></td>
<td> Läuft noch bis</td>
<td><IMG SRC="../../../images/blind.gif" WIDTH="10" HEIGHT="10"></td>
<td> Beschreibung</td>
<td> </td>
</tr>
<TR>
<TD colspan=5><HR></TD>
<TD> </TD>
</TR>
<?php
if( !$res = mysql_query( $result ) )
{
echo "Tja. Das war wohl nix.\n";
}
else
{
while($wert = mysql_fetch_array($result))
{
echo "<tr>
<td align=left valign=top class=menue>
" . $wert['sitetitle'] . "</td>
<td> </td>
<td align=center valign=top class=text>
" . $wert['expiredate'] . "</td>
<td> </td>
<td align=left class=text>
" . $wert['sitedescription'] . "</td>
<td> </td>
</tr>
<TR>
<TD colspan=5><HR></TD>
<TD> </TD>
</TR>
\n";
}
}
?>
</table>
<!--//########################### TOP ANGEBOTE ENDE ############################ -->
Das die ausgabe im HTML
Es soll am besten die ausgegebene Tabelle gegen den Text das nix da ist ersetzt werden.
hmhm wenn ich nur selber schon etwas weiter wäre
EDIT: Ok habe es hinbekommen, nur ersetzt er mir die tabelle nicht gegen den text.
PHP-Code:
<?php
if( !$res = mysql_fetch_object( $result ) )
{
echo "<font color=#ff2f11><b>Keine besonderen Angebote vorhanden!</b></font>";
}
else
{
while($wert = mysql_fetch_array($result))
{
echo "<tr>
<td align=left valign=top class=menue>
" . $wert['sitetitle'] . "</td>
<td> </td>
<td align=center valign=top class=text>
" . $wert['expiredate'] . "</td>
<td> </td>
<td align=left class=text>
" . $wert['sitedescription'] . "</td>
<td> </td>
</tr>
<TR>
<TD colspan=5><HR></TD>
<TD> </TD>
</TR>
\n";
}
}
?>
Lesezeichen