Php recursive functions with unlimited classification. This infinite classification php recursive function is a recursive php and SQL query method. it is very simple to query a query without any subclass of the current category. if so, you can call the function itself to operate it, this infinite classification php recursive function is a recursive php and SQL query method. it is very simple to query a query without any subclass of the current category. if so, you can call the function itself to operate it, if no subclass exists, the system returns the result.
This infinite classification php Tutorial recursive function is a php and SQL query recursive method, it is very simple to query a current classification does not have a subclass, if there is a, then call the function itself to operate, if no subclass exists, the system returns the result.
Function createsortoptions ($ selected = 0, $ parent_id = 0, $ n =-1)
{
Global $ db;
$ SQL = "select * from '@__ article_sort 'where' parent _ id' =' {$ parent_id }'";
$ Options = ";
Static $ I = 0;
If ($ I = 0)
{
$ Options. =' If ($ row ['sort _ id'] = $ selected)
{
$ Options. = 'selected ';
}
$ Options. = ">". str_repeat ('', $ n * 3). $ row ['sort _ name']."N ";
$ Options. = createsortoptions ($ selected, $ row ['sort _ id'], $ n );
}
}
Return $ options;
}
If you are using the smarty template, you can call
//-$ Tpl-> assign ('sort _ list', createsortoptions ());
//-$ Tpl-> assign ('sort _ list', createsortoptions ($ sort_id ));
Recursive functions are a recursive method for php and SQL queries. it is very simple to query a query without any subclass of the current category. if so, you can call the function itself to operate it ,...