Databases: help me about coding by Nutchada Kosumsawas - Wednesday, 17 January 2007, 5:05 PM Number of replies: 2 Hi all I'm a new moodle user. I would like to ask you if I have a code >> $strSQL = "select subid,name from table1 where id = $id and stepid=$stepid"; How could I code in moodle style. Thanks Average of ratings: - Permalink Reply In reply to Nutchada Kosumsawas Re: Databases: help me about coding by Tim Hunt - Thursday, 18 January 2007, 2:32 AM You are probably looking for$data = get_record('table1', 'id', $id, 'stepid', $stepid, '', '', 'subid,name');the get_record function (and many others) are defined in lib/dmllib.php. Average of ratings: - Permalink Show parent Reply In reply to Tim Hunt Re: Databases: help me about coding by Nutchada Kosumsawas - Thursday, 18 January 2007, 11:52 PM Thank you Tim your suggestion is very useful for me ^o^ Average of ratings: - Permalink Show parent Reply
In reply to Nutchada Kosumsawas Re: Databases: help me about coding by Tim Hunt - Thursday, 18 January 2007, 2:32 AM You are probably looking for$data = get_record('table1', 'id', $id, 'stepid', $stepid, '', '', 'subid,name');the get_record function (and many others) are defined in lib/dmllib.php. Average of ratings: - Permalink Show parent Reply In reply to Tim Hunt Re: Databases: help me about coding by Nutchada Kosumsawas - Thursday, 18 January 2007, 11:52 PM Thank you Tim your suggestion is very useful for me ^o^ Average of ratings: - Permalink Show parent Reply
In reply to Tim Hunt Re: Databases: help me about coding by Nutchada Kosumsawas - Thursday, 18 January 2007, 11:52 PM Thank you Tim your suggestion is very useful for me ^o^ Average of ratings: - Permalink Show parent Reply