Welcome Guest, Not a member yet? Register   Sign In
News by category
#1

[eluser]Guerra[/eluser]
Hi all, how to withdraw all news relating to certain categories? Categories output in url site/name e.g. $name = $this->uri->segment(1) :gulp: Can anyone show an example?
#2

[eluser]Dam1an[/eluser]
You would need a lookup to get the category ID based on the name
If a news story can only have a single category, then its just a simple where clause, if it can have many categories, you will need a join in there as well
#3

[eluser]Guerra[/eluser]
Can you pls demonstrate how to query the database?
#4

[eluser]Dam1an[/eluser]
Have a look at the user guide
It's all simple enough
#5

[eluser]xwero[/eluser]
Dam1an i think you took over my patience because i got tired answering questions like that. I promote you to Sr. Research Associate if i was in charge Smile
#6

[eluser]wiredesignz[/eluser]
[quote author="xwero" date="1244136061"]...I promote you to Sr. Research Associate if i was in charge Smile[/quote]

+1 for Damian Tongue
#7

[eluser]TheFuzzy0ne[/eluser]
That would certainly be a big improvement on his current position - tea lady. Tongue
#8

[eluser]Dam1an[/eluser]
Thanks guys, now if you could put in a good word with the mods Wink
And Fuzzy, after that insult, you better be careful with the coffee I serve you, never know whats going to be in it lol
#9

[eluser]Guerra[/eluser]
Dam1an THX. How correct write this query to AR?
$Q = $this->db->query("SELECT * FROM topics, category
WHERE cat_name = category.name AND cat_name = '$name'");
return $Q->result_array();




Theme © iAndrew 2016 - Forum software by © MyBB