PHP-MYSQL多表查询

PHP-MYSQL多表查询,php,mysql,Php,Mysql,我有两张桌子“pututs”和“hututs”。我正在使用一个方法来显示所有返回的行。虽然我不知道如何设置它来运行多个查询,但我只能让它一次返回一个查询。这是我的密码 public function QueryAll($my_field, $limit) { $query = mysql_query("SELECT * from $my_field LIMIT $limit"); $rows = array(); while($row = mys

我有两张桌子“pututs”和“hututs”。我正在使用一个方法来显示所有返回的行。虽然我不知道如何设置它来运行多个查询,但我只能让它一次返回一个查询。这是我的密码

   public function QueryAll($my_field, $limit) {

        $query = mysql_query("SELECT * from $my_field LIMIT $limit");
        $rows = array();

    while($row = mysql_fetch_array($query)) {
        $rows[] = $row;

    }

  return $rows;   }
这是我的索引文件

 <?php $results = $Database->QueryAll('p_tuts', 5); ?>       
    <?php foreach ($results as $result): ?>
           <div class="tutorial">
                <div class="tut_header"><h2><a href="view_article_p.php?id=<?php echo $result['id']; ?>" title="<?php echo $result['tut_header']; ?>"><?php echo $result['tut_header']; ?></a></h2></div>
                <div class="tut_poster">Posted by: <a href="#" title="Adam"><?php echo $result['tut_poster']; ?></a> on <?php echo $result['tut_date']; ?></div>
                <div class="tut_img rounded"><img src="<?php echo "img_uploads/". $result['tut_img']; ?>" width="180" height="151" /></div>
                <div class="tut_content"><p><?php $Website->CharLimit($result['tut_content'], 800); ?></p></div>   
          </div>
            <?php endforeach; ?>

投寄人:于
“width=“180”height=“151”/>

我真的很想修改它,这样我就可以使用这个类来显示两个多表,而不仅仅是一个表


亲切问候

如果不知道这两个表之间的关系,很难回答这个问题,但看起来您需要使用or