datalib.php get_courses_search --explanation

datalib.php get_courses_search --explanation

by Lakshmi Sundar -
Number of replies: 4

Hai

function get_courses_search($searchterms, $sort="fullname ASC", $page=0, $recordsperpage=50, &$totalcount)

Could some one explain in detail the arguments of this function .An example syntax on calling the function and its return type would be better.

I have a problem :

Warning: Invalid argument supplied for foreach() in e:\apache\apache\htdocs\moodle\lib\datalib.php on line 1792

I searched the database with a single string as $searchterms:

$listsearch=get_courses_search($searchstring,"fullname ASC",2,50,&$tc);

Is there any completet documentation availabale for all the API of moodle.

regards,

Sundar

Average of ratings: -
In reply to Lakshmi Sundar

Re: datalib.php get_courses_search --explanation

by Teemu Sumi -
Remove that "&" from your function call. It could be used in function definition to allow argument change (adding something to a string for example).


Teemu
In reply to Teemu Sumi

Re: datalib.php get_courses_search --explanation

by Lakshmi Sundar -

Thanks Teemu!

The code works fine now!

The problem was that I didnt give $searchterms as an array!The error free code would be:

$searchterms=explode(" ",$searchstring);

get_courses_search($searchterms,"fullname ASC",0,10,&$tc);

But I still find problem with the functions in the moodle library!

Does anyone have a complete document on what are all the:

1 global variables available for pages with in the moodle application

2 functions available in the moodle library

3 classes available in the moodle library

It would just make the moodler's hacking more easier!

Thanks Teemu!

Sundar