adamFTW
08-12-2007, 04:04 PM
I have the following code, how could I make it so above the entries, it would say "There are a total of XX entries".
Is it possible?
Heres my code:
<?php
// The database connetcion
include "config.php";
$sql = "SELECT * FROM petition";
$check = mysql_query("SELECT name, grade, comment FROM petition") or die("Sorry, the data couldn't be displayed. Please check back later.");
// The above variables will be used to check our connection to MySQL.
while ($display = mysql_fetch_array($check)) {
$name = $display['name'];
$grade = $display['grade'];
$comment = $display['comment'];
// Above are variables defined for our Name, Gradeand Comment.
echo "
<strong>Name:</strong> $name
<br>
<strong>Grade / Other:</strong> $grade
<br>
<strong>Comment:</strong><br>$comment
<br>
__________________________________________________ __________<br /><br />
";
}
?>
Is it possible?
Heres my code:
<?php
// The database connetcion
include "config.php";
$sql = "SELECT * FROM petition";
$check = mysql_query("SELECT name, grade, comment FROM petition") or die("Sorry, the data couldn't be displayed. Please check back later.");
// The above variables will be used to check our connection to MySQL.
while ($display = mysql_fetch_array($check)) {
$name = $display['name'];
$grade = $display['grade'];
$comment = $display['comment'];
// Above are variables defined for our Name, Gradeand Comment.
echo "
<strong>Name:</strong> $name
<br>
<strong>Grade / Other:</strong> $grade
<br>
<strong>Comment:</strong><br>$comment
<br>
__________________________________________________ __________<br /><br />
";
}
?>