Welcome Guest, Not a member yet? Register   Sign In
How can I do this with CodeIgniter
#1

[eluser]Marcus Marden[/eluser]
Code:
$SQL1 = mysql_query("SELECT id, name FROM categories ORDER BY name ASC");
while(list($cat_id, $cat_name) = mysql_fetch_row($SQL1)) {
$cat_name = stripslashes($cat_name);
$SQL2 = mysql_query("SELECT name, content FROM blog WHERE category='$cat_id' ORDER BY id DESC LIMIT 5");
while(list($name, $content) = mysql_fetch_row($SQL2)) {
  $name = stripslashes($name);
  $content = stripslashes($content);
}
}

Showing like that:
Code:
News
-> news 1
-> news 2
-> news 3
-> news 4
-> news 5

Games
-> game 1
-> game 2
-> game 3
-> game 4
-> game 5

Thank you for advice.


Messages In This Thread
How can I do this with CodeIgniter - by El Forum - 10-13-2012, 01:08 PM
How can I do this with CodeIgniter - by El Forum - 10-13-2012, 02:13 PM
How can I do this with CodeIgniter - by El Forum - 10-13-2012, 03:25 PM
How can I do this with CodeIgniter - by El Forum - 10-14-2012, 12:25 PM
How can I do this with CodeIgniter - by El Forum - 10-14-2012, 03:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB