How can I do this with CodeIgniter |
[eluser]Marcus Marden[/eluser]
Code: $SQL1 = mysql_query("SELECT id, name FROM categories ORDER BY name ASC"); Showing like that: Code: News Thank you for advice.
[eluser]CroNiX[/eluser]
Try the tutorials and the user guide. There are several examples on how to do these basic CI things.
[eluser]rip_pit[/eluser]
you can have a look there for every DB querying methods : http://www.codeigniter.fr/user_guide/dat...ecord.html You can use a ->join to query multiple tables using one unique query. then use a simple foreach to filter the results and separate the cat. Something like : Code: $this->db->select('blog.*, categories.id, categories.name');
[eluser]egy_programozo[/eluser]
rip_pit's code v1.2 Code: $this->db->select('blog.*, categories.id as category_id, categories.name as categories_name'); |
Welcome Guest, Not a member yet? Register Sign In |