title: Php - how to do multiple search w/ multiple output alternately?
body: <p>I have a question regarding on multiple output alternately with only one search engine....I have this scenario below..</p>
  
  <p>Scenario:</p>
  
  <ol>
  <li>First search the data. The output will go in <code>textarea1(id='content')</code></li>
  <li>Second search the data. The output will go in <code>textarea2(id='content1')</code></li>
  <li>Third search the data. The output will go in <code>textarea3('content2')</code></li>
  </ol>
  
  <p>NOTE:I only used one search engine..</p>
  
  <p>Please help me :(
  Thank you and have a nice day!
  Below is my code</p>
  
  <p>Table: users</p>
  
  <pre><code> CREATE TABLE users
   (id INT PRIMARY KEY AUTO_INCREMENT,
   name VARCHAR(50),
   age INT)
  </code></pre>
  
  <p>index.php</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
      &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
      function get() {
          $.post('data.php', {
                  name: form.search.value
              },
              function(output) {
                  $('#content').html(output).show();
                  $('#content1').html(output).show();
                  $('#content2').html(output).show();
              });
      }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;p&gt;
          &lt;form name="form"&gt;
              &lt;input type="text" name="search"&gt;
              &lt;input type="button" value="Get" onClick="get();"&gt;
          &lt;/form&gt;
          &lt;div&gt;
              &lt;textarea id='content' cols='15' rows='5'&gt;&lt;/textarea&gt;
              &lt;textarea id='content1' cols='15' rows='5'&gt;&lt;/textarea&gt;
              &lt;textarea id='content2' cols='15' rows='5'&gt;&lt;/textarea&gt;
          &lt;/div&gt;
      &lt;/p&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>data.php</p>
  
  <pre><code>&lt;?php
  require 'connection.php';
  
  $name = mysql_real_escape_string($_POST['name']);
  
  if($name==NULL)
  echo "Please enter a name";
  
  else{
  $age = mysql_query("SELECT age FROM users WHERE memberName='$name'");
  $age_num_rows = @mysql_num_rows($age);
  
  if($age_num_rows==0)
  echo "Name does not exists";
  
  else
  {
  $age = mysql_result($age, 0);   
  echo "$name's age is $age";
  }
  }
  </code></pre>