<html>
<body>

<?php

$con = mysql_connect("localhost","root"); if (!$con) { die('Could not connect: ' . mysql_error()); }

mysql_select_db("comentss", $con);

if(isset($_POST['submit'])){ $comment=$_POST['comments']; $q="insert into table2 (comment) values ('$comment')"; mysql_query($q); } $q="select comment from table2"; $result=mysql_query($q); while($row=mysql_fetch_array($result)){ //this is what i want to separate with tables... echo "" . "
" . $row['comment']."";

} ?>

</body>
</html>

Can you please give an example of what you want? (Try to use code tags too.)

<html>
<body>

<?php

$con = mysql_connect("localhost","root"); if (!$con) { die('Could not connect: ' . mysql_error()); }

mysql_select_db("comentss", $con);

if(isset($_POST['submit'])){ $comment=$_POST['comments']; $q="insert into table2 (comment) values ('$comment')"; mysql_query($q); } $q="select comment from table2"; $result=mysql_query($q); while($row=mysql_fetch_array($result)){ //this is what i want to separate with tables... echo "" . "
" . $row['comment']."";

} ?>

</body>
</html>

this code is for a "add comment" function. i want the comments to be separated with a table or something..

can i post a picture here?

i still don't get what you want...yes please....

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.