Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Abfrageergebnisse in einer Tabelle drucken

So:

<?php
$result = mysql_query("SELECT subject, actions FROM info WHERE category='$find' ORDER BY votes DESC") or die(mysql_error());

if(mysql_num_rows($result) > 0): ?>
<table>
    <tr>
        <th>Subject</th>
        <th>Actions</th>
    <tr>
    <?php while($row = mysql_fetch_assoc($result)): ?>
    <tr>
        <td><?php echo $row['subject']; ?></td>
        <td><?php echo $row['actions']; ?></td>
    </tr>
    <?php endwhile; ?>
</table>
<?php endif; ?>