Hi..
I got to query that i want to execute here..It is again like facebook wall system,where the first query is for executing all the "wall post",while the other query is for executing the comment for the post.

So basically,i need two query for that,which I've written them down like this :

<ul id="wall">
          <?php
           include('insert.php');
           $test=mysql_query("SELECT*FROM wall ORDER BY id DESC");
                	
              while($row=mysql_fetch_array($test)){
                echo "<li class='stbody'><div class='stimg'></div><div class='sttext'>".
                      $row["message"].
                      
                     "<div class='below'><div class='sttime'>2 seconds ago</div>
		      <div class='help-toggle'>| Help |</div>
		      <div class='trigger_default'><a href='#'>Discuss</a></div>
		      <div class='toggle_container_default'>
       
	              <ul class='reply_text'>
                         <!--This is where i try to execute the second query
                          where the comment for each wall post appear--> 
                         <?php include(get_reply.php); ?>
                      </ul>
		       
   <div class='block'>
      <form name='disscuss_text' id='post_reply' id='post_reply'>
        <textarea rows='3' cols='87' id='discuss_text' name='discuss_text'></textarea>
        <input type='submit' value='Post' name='Help' id='post-button' />
      </form>
   </div>
		</div>
	        </div>	
	        </li>";
		
                }
                ?>
            </ul>

So,to do this what i've tried is i am writing another file with the name of get_reply.php which contain the second query that i want to execute.This is what i've written there:

<?php
include("config.php");
$test3=mysql_query("SELECT*FROM reply");

while($row3=mysql_fetch_array($test3)){
	echo $row3['message'].'<br/>';
}

?>

The get_reply file run correctly by itself,but i cannot run it when i include this file inside the first file that i've shown you.Nothing appear there within the <ul> container.

Whats the problem?Has i done this incorrectly??

Help me please..Thank You :)

Recommended Answers

All 2 Replies

<ul id="wall">
          <?php
           include('insert.php');
           $test=mysql_query("SELECT*FROM wall ORDER BY id DESC");
                	
              while($row=mysql_fetch_array($test)){
                echo "<li class='stbody'><div class='stimg'></div><div class='sttext'>".
                      $row["message"].
                      
                     "<div class='below'><div class='sttime'>2 seconds ago</div>
		      <div class='help-toggle'>| Help |</div>
		      <div class='trigger_default'><a href='#'>Discuss</a></div>
		      <div class='toggle_container_default'>
       
	              <ul class='reply_text'>
                         <!--This is where i try to execute the second query
                          where the comment for each wall post appear--> ";
                         ?> <?php include(get_reply.php); ?><?
                echo "      </ul>
		       
   <div class='block'>
      <form name='disscuss_text' id='post_reply' id='post_reply'>
        <textarea rows='3' cols='87' id='discuss_text' name='discuss_text'></textarea>
        <input type='submit' value='Post' name='Help' id='post-button' />
      </form>
   </div>
		</div>
	        </div>	
	        </li>";
		
                }
                ?>
            </ul>

I have just modified your code, Just look at it.

thanks you,but it turns out that there is something wrong with my code.
Once i put the code that you have modified, an error come out,that saying this :


Parse error: syntax error, unexpected $end in C:\xampp\htdocs\smartforum\home.php on line 345

i dont know whats wrong,but i think it is something with the code that you are provided me because the rest seems okay..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.