Page 1 of 1

How to detect Post Id from Slug

Posted: Thu Jul 12, 2012 2:58 am
by shafiq2626
Hi to all.
I have a data in news panel and also I saved slug against this value.
My link make like this.

http://ilm.com.pk/portal/events/this-is ... ther-event

So How I can detect Id from slug to display data.

My Query is like this

Code: Select all

$sql = $this->MMdbobj->query("SELECT * FROM  tbl_news where news_id=$_REQUEST[event_id]");
				$sendcontents = $this->MMdbobj->fetch_assoc();
How will I Get Event Id from Slug /this-is-new-another-event
Please help.

Re: How to detect Post Id from Slug

Posted: Thu Jul 12, 2012 4:02 pm
by requinix
What values do you have in $_REQUEST?