Q and A::search, sort, pagination in XOOPS
You really should start by reading XoopsObject class located in XOOPS255/kernel/object.php
That is the heart of any module to do anything using database include search,sort,order,pagination,...
so you should stop writing these kind of codes:
you should create the sql file for every table and start create a class for that table.
I recommend to see publisher as a very profesional module.
lets start with an example from publisher module.
we want to see how we can write a class for table publisher_categories in sql file.
at first you can see the table fields and structure in sql file:
http://svn.code.sf.net/p/xoops/svn/Xo ... k/publisher/sql/mysql.php
You really should start by reading XoopsObject class located in XOOPS255/kernel/object.php
That is the heart of any module to do anything using database include search,sort,order,pagination,...
so you should stop writing these kind of codes:
global $xoopsDB;
$result= mysql_query("SELECT * FROM ".$xoopsDB->prefix("directory_info")." where name like '%" . $_POST['search'] . "%' or unit like '%" . $_POST['search'] . "%' or department like '%" . $_POST['search'] . "%' or position like '%" . $_POST['search'] . "%' ORDER BY name");you should create the sql file for every table and start create a class for that table.
I recommend to see publisher as a very profesional module.
lets start with an example from publisher module.
we want to see how we can write a class for table publisher_categories in sql file.
at first you can see the table fields and structure in sql file:
http://svn.code.sf.net/p/xoops/svn/Xo ... k/publisher/sql/mysql.php
CREATE TABLE `PUBLISHER_categories` (
`categoryid` int(11) NOT NULL auto_increment,
`parentid` int