Why does this code return the number of rows twice?
<?php
include("dbinfo.php");
$link = mysql_connect($mysql_host, $mysql_user, $mysql_password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($mysql_database, $link);
$result = mysql_query("SELECT * FROM apptable");
$no = mysql_num_rows($result);
mysql_close($link);
echo "<h1><big>".$no."</big></h1>";
?>
Also, can someone access dbinfo.php somehow and get to the password?
Sorry, I’m using the following code to display this output, but it shows the number of rows twice, once with formatting and the other without.
<td>
<?php include("regcount.php"); echo $no; ?>
</td>
Because you’re including the file (which echos it) then you’re echoing it again.