首先,我是 PHP 和 MySQL 的新手。
我的目标是显示数据库中学生的证词。它显示了两个证词,但我需要它们是两个不同的证词。请帮忙!
<div class="block_main_testimonials">
<h4>Student Corner</h4>
<?php
// Connect to the file above here
require "includes/connect.php";
$data = mysql_query("SELECT * FROM `testimonials` ORDER BY RAND() LIMIT 0,2")
or die(mysql_error());
$info = mysql_fetch_array( $data ) ;
?>
<div class="one_half">
<div class="block_testimonials_2">
<div class="content">
<div class="text">
<p>“<?php echo $info['quote'] ;?>”</p>
<div class="tail"></div>
</div>
<div class="author">
<p><?php echo $info['name'] ; ?>,<span class="position"> <a href="<?php echo $info['url'] ; ?>"> <?php echo $info['department']; ?></a></span></p></div>
</div>
<div class="clearboth"></div>
</div>
</div>
<div class="one_half last">
<div class="block_testimonials_2">
<div class="content">
<div class="text">
<p>“<?php echo $info['quote'] ;?>”</p>
<div class="tail"></div>
</div>
<div class="author">
<p><?php echo $info['name'] ; ?>,<span class="position"> <a href="<?php echo $info['url'] ; ?>"> <?php echo $info['department']; ?></a></span></p></div>
</div>
<div class="clearboth"></div>