Hi guys,
I need your help. I have a blog and on a complete different page my homepage. Now what I want to do is that if I post a new post on my blog that the first 35 words of it appear in a layer, and then as well next to it the publish date.
I realized that I would need to create an mysql query which comes up with the last entry,
How can I do that? And then which is probably more complicated how can I tell mysql to give me just 35 words, or can I limit in any way the layer????
I am helpless! I would deeply appreciate if someone could help me!
Thanks!
PhP Mysql query blog latest results
Moderator: General Moderators
-
gwolff2005
- Forum Commoner
- Posts: 68
- Joined: Sun Apr 05, 2009 10:58 am
Re: PhP Mysql query blog latest results
ok you can retrieve the last id by using
thatll retrieve your last insert id, then select using $blogid,
to show only a part of your string using php you can use The Substr () PHP Function
this is written as:
atleast you have a lead now, abu
Code: Select all
$lastid = mysql_query( "SELECT last_insert_id()" );
$blogid = mysql_result($lastid,"blog_Id");to show only a part of your string using php you can use The Substr () PHP Function
this is written as:
Code: Select all
[b]substr (string, start, optional length);.[/b]