Kod
<table>
<tr>
<td align="center" class="sekcjaTytul">
<?php
mysql_select_db($database_sql, $sql);
$query_splash = "SELECT tytul, autor, tresc, id FROM artykuly WHERE typ = 'splash' ORDER BY RAND() LIMIT 1";
$splash = mysql_query($query_splash, $sql) or die(mysql_error());
$row_splash = mysql_fetch_assoc($splash);
echo $row_splash['tresc']; ?></td>
</tr>
<tr>
<td><?php echo $row_splash['tytul']; ?> :: <?php echo $row_splash['autor']; ?></a></td>
</tr>
</table>
Problem:
<tr>
<td align="center" class="sekcjaTytul">
<?php
mysql_select_db($database_sql, $sql);
$query_splash = "SELECT tytul, autor, tresc, id FROM artykuly WHERE typ = 'splash' ORDER BY RAND() LIMIT 1";
$splash = mysql_query($query_splash, $sql) or die(mysql_error());
$row_splash = mysql_fetch_assoc($splash);
echo $row_splash['tresc']; ?></td>
</tr>
<tr>
<td><?php echo $row_splash['tytul']; ?> :: <?php echo $row_splash['autor']; ?></a></td>
</tr>
</table>
Zdarza się, że pomito tego iż w bazie wszystko jest OK, nie ma pól pustych, to $row_splash['tresc'] potrafi czasem byc puste...
Macie może jakiś pomysł dlaczego?