What would cause my readout to print only the first digit in a two digit result?
$result = mysql_query("SHOW tables", $db);
echo "<BR><BR><B>Current Tables:</B><BR>";
while($row = mysql_fetch_row($result)){
$rowA[0] = str_replace ("_", " ", $row[0] );
$query2 = "SELECT COUNT(*) FROM $row[0]";
$result2 = mysql_query($query2);
$count = mysql_result($result2,0,0);
echo $rowA[0]. " has <SPAN STYLE='color:red;'>" .$count[0]. "</SPAN> records.<BR>";
}
But if I count the rows without a variable for the table name, it works fine.
$result2 = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result2);
Not sure what is causing this. Also not sure where to search for answers.