[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sheflug] php / moodle problem



On Tue, May 30, 2006 at 09:31:40PM +0100, David Willington wrote:
>   //Get a course id
>   $arr_details=explode(",",$str_details);
>   $sql="SELECT id FROM mdl_course WHERE idnumber='".$arr_details[1]."'
> LIMIT 1";

I suspect the issue lies with this line of generated SQL.  Have you
printed it out for a sanity check?

Possibly the issue is that the output from file() still contains
newlines.  You may want to do this:

// Get a course id
$arr_details = explode(',', rtrim($str_details));


mysql_fetch_array() returning FALSE is not an error - it just means
that there were no results to fetch.


-- 
Ben Spencer

Hellenologophobia - Fear of Greek terms or complex scientific terminology

___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.