Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result resource in /home/clocky/public_html/showalldata.php on line 20
Look at what it is telling you. Count lines or use the Code Editor in cPanel or note the place you call mysql_fetch_field is
Code:
while ($field = mysql_fetch_field($result))
It is saying that $result is not a valid result. Where did it come from?
Code:
$result = mysql_query($sql, $conn);
mysql_query returns a result object on SELECT queries (even if there are no matches), unless there is an error. Hence you have an error.
To display the problem, always test the return value of the query.
Code:
$result = mysql_query($sql, $conn);
if (!$result) {
echo('MySQL error: ' . mysql_error());
}