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

Re: [sheflug] php / moodle problem



On Tuesday 30 May 2006 21:31, David Willington wrote:
> Dear All
>
> I'm not sure if I'm missing something obvious, but I've hit a brick
> wall. I'm writing a set of php / shell scripts to import pupils,
> teachers and courses from SIMS into moodle, and I've hit a php problem I
> can't get my head round.  There's a set of csv data in a text file
> (pupil_enrollment.txt)
>

You're connecting to MySQL, but you're not selecting a database.
You need to do something like:
$conn = mysql_connect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass);
$db = mysql_select_db($dbname, $conn);

Regards,
David.

-- 
David Johnson
www.david-web.co.uk - My Personal Website
www.penguincomputing.co.uk - Need a Web Developer?

___________________________________________________________________

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

  GNU the choice of a complete generation.