General developer forum

Databases: Trouble Running Multiple Queries in 2.0

 
 
Me
Databases: Trouble Running Multiple Queries in 2.0
 

It seems like I can run only one  sql query per page.

$sql_one = "select * from tbl";
$result_one = $DB->get_record_sql($sql_one);

$sql_two = "select * from tbl";
$result_two = $DB->get_record_sql($sql_two);

For some reason, the second one does not work and the page is just blank. How can I fiqure out what is going on?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Databases: Trouble Running Multiple Queries in 2.0
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

If you are doing development set Debugging to DEVELOPER level.

 
Average of ratings: -
Me
Re: Databases: Trouble Running Multiple Queries in 2.0
 

ERROR:

Coding error detected, it must be fixed by a programmer: moodle_database::execute() Multiple sql statements found or bound parameters not used properly in query

Any help would be great!

 
Average of ratings: -
Picture of Herson Cruz
Re: Databases: Trouble Running Multiple Queries in 2.0
 

Same issue here!

 
Average of ratings: -