I'm assuming that your variable $table does not include quotes and it must be quoted in the WHERE clause:
$update = " update TABLENAME SET LASTMOD=current_timestamp WHERE TABLE_NAME='$table'";
A call to oci_error() would reveal any syntax errors in your query.
Note also, that according to the documentation, if this is PL/SQL the statement must end in a ; as
$update = " update TABLENAME SET LASTMOD=current_timestamp WHERE TABLE_NAME='$table';";
The statement would be better done as a proper prepared statement though, with bound parameters:
$update = " update TABLENAME SET LASTMOD=current_timestamp WHERE TABLE_NAME=:table;";
$stmt = oci_parse($conn, $update);
oci_bind_by_name($stmt, ':table', $table);
$result = oci_execute($stmt, OCI_DEFAULT);
if (!$result) {
echo oci_error();
}