That means your array contains blank items in it, if you were to print_r it im sure you would see blanks.
for the meantime try adding
foreach ($tables as $key => $value) {
if ($value == NULL) { unset($tables[$key]); }
}
like:
$sql = mysql_query("SELECT tablename FROM tablenames") or die (mysql_error());
$tables = array();
while($row = mysql_fetch_array($sql)) {
$tables[] = $row[0];
}
foreach ($tables as $key => $value) {
if ($value == NULL) { unset($tables[$key]); }
}
$data = implode(", ", $tables);
print $data;
This is just a workaround, all it is doing is removing the blanks from the array... and hopefully this will work.