Getting last post of a user
-
I’m trying to get the content of the last post by a particular author using php. I didn’t see any easy way through the function reference so I tried this bit of code:
$array_content=mysql_query("SELECT post_content FROM wp_posts WHERE post_author = $userID"); $last_content = end($array_content); echo $last_content;
But the result of the sql query isn’t an array as I expected. It gives me some sort of reference instead: “Resource id #58”
I really don’t understand sql very well, and would appreciate a kick in the right direction.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Getting last post of a user’ is closed to new replies.