$database
Query: $query
Results
";
if ($result == 0)
echo("Error " . mysql_errno() . ": " . mysql_error() . "");
elseif (@mysql_num_rows($result) == 0)
echo("Query completed. No results returned.
");
else //begin table
{
echo "
";
for ($i = 0; $i < mysql_num_fields($result); $i++)
{
echo("| " . mysql_field_name($result,$i) . " | ");
}
echo "
";
$count=0;
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
echo "";
$row = mysql_fetch_row($result);
$count++;
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo("| " . $row[$j] . " | ");
}
echo "
";
}
echo "
";
echo "Count=".$count;
} //end table
if ($columns!="")
{$query="SHOW COLUMNS FROM ".$table;
$result = mysql_query($query);
if ($result == 0)
echo("Error " . mysql_errno() . ": " . mysql_error() . "");
elseif (@mysql_num_rows($result) == 0)
echo("Query completed. No results returned.
");
else
{
echo "
";
for ($i = 0; $i < mysql_num_fields($result); $i++)
{
echo("| " . mysql_field_name($result,$i) . " | ");
}
echo "
";
$count=0;
for ($i = 0; $i < mysql_num_rows($result); $i++)
{
echo "";
$row = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo("| " . $row[$j] . " | ");
}
$count++;
echo "
";
}
echo "
";
echo "Count=".$count;
}
}
?>