How to get the excerpt of a page before more tag?

The content is manipulated by the get_the_content function, and that function always assumes the current post in the Loop. You can’t pass it an ID, strangely.

The easiest way to get just the bit before the more for an arbitrary post ID is:

$p = get_post(1);
$p = preg_split( '/<!--more(.*?)?-->/', $p->post_content );
echo $p[0];

There may be ways to hijack the global $post variable but unless you really need the complex manipulation of get_the_content I wouldn’t bother. You can always create a near clone of that function that will allow you to pass an ID into it.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)