title: Retrieving mysql data on to one php page from multiple tables
body: <p>I am a student still new to php and mysql,i am developing a website which is database driven. It has two pages i.e index.php and subpage.php.
  On the index page there appears 14 links namely about_us,projects,services,partners and among others. And for the case of the subpage.php, it has "a blank body",the header, navigation and the footer.</p>
  
  <p>My goal is to not to create pages for every link that appears on the index.php. So i want to use only the "blank body" in the subpage.php to display the data for every link that is on the index.php whenever it is clicked on.</p>
  
  <p>In my struggle to achieve this, i have created a database with 14 tables so that each should cater for every link on the index.php.</p>
  
  <p>So I would like you guys to help me how i can RETRIEVE DATA FROM THE DATABASE FROM DIFFERENT TABLES ON TO THE SUBPAGE.PHP</p>
  
  <p>Forexample;
  If am am on the index.php and i click about_us, it should ONLY retrieve data from the table called about us in the database.
  And if i click another link it should on retrieve data specifically for that link i have clicked on.</p>
  
  <h2>Here is the sample php codes that am using to retrieve data for only projects_table onto the subpage.php</h2>
  
  <pre><code>&lt;?php
  require_once("connection.php");
  ?&gt;
  
  &lt;table&gt;
  &lt;?php
  mysql_select_db("cognative_db",$sql);
  $sql="SELECT * FROM projects_table ";
  $result=mysql_query($sql);
  
  
  while($row=mysql_fetch_array($result)){
  ?&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;?php echo $row['project_title'];?&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;?php echo $row['project_details'];?&gt;
   &lt;?php echo " ";?&gt;
   &lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;?php
  }
  ?&gt;
  &lt;?php
  mysql_close();
  ?&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <hr>
  
  <p>Any help will be highly appreciated</p>