0

I would like to create a system to issue opinions on a given thing. I'm at a good point, but I can not get created for each element taken from the database a correspond div. Let me explain, for example if I have three reviews made by the three authors, I would like three divs for the reviews, and three for the authors, then automatically generated by the loop. How can i do?

2
  • I do not get your question properly... Do you want to display $Feedback,$UserNick and $UserMail inside html div tag? Commented Nov 30, 2013 at 14:10
  • Hi, no, I want that for every element taken from the database is automatically created a div. Commented Nov 30, 2013 at 14:11

1 Answer 1

2

You can do this.. First of all add <body> tag to your html document

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <?php

      $Content = mysql_query("SELECT * FROM feedback");

        while($Row = mysql_fetch_array($Content)) {

        $Feedback = $Row['FeedbackUser'];
        $UserNick = $Row['UserNickname'];
        $UserMail = $Row['UserEmail'];

echo "<div>{$Feedback}</div>"; // Displaying feedback as div
echo "<div>{$UserNick }</div>"; // Displaying UserNick as div
echo "<div>{$UserMail }</div>"; // Displaying UserMail as div 


  }
?>
</body>

Hope this is what you are looking for

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.