[svn r18543] Minor - Fixed warning about mysql_result into exercise tool - see FS#3510

skala
Cristian Fasanando 17 years ago
parent 194957ef33
commit b2ecfdc4cc
  1. 4
      main/exercice/answer_admin.inc.php
  2. 6
      main/exercice/question.class.php
  3. 20
      main/inc/lib/database.lib.php

@ -22,7 +22,7 @@
* This script allows to manage answers. It is included from the script admin.php
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: answer_admin.inc.php 18203 2009-02-03 18:02:16Z ndieschburg $
* @version $Id: answer_admin.inc.php 18543 2009-02-17 15:04:15Z cfasanando $
*/
@ -1160,7 +1160,7 @@ if($modifyAnswers)
?>
     
<?php
echo $desc = mysql_result($res,0,'description');
echo $desc = Database::result($res,0,'description');
?>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?modifyAnswers=<?php echo $modifyAnswers; ?>">

@ -1,4 +1,4 @@
<?php // $Id: question.class.php 18487 2009-02-13 04:02:46Z ivantcholakov $
<?php // $Id: question.class.php 18543 2009-02-17 15:04:15Z cfasanando $
/*
==============================================================================
@ -28,7 +28,7 @@
* File containing the Question class.
* @package dokeos.exercise
* @author Olivier Brouckaert
* @version $Id: question.class.php 18487 2009-02-13 04:02:46Z ivantcholakov $
* @version $Id: question.class.php 18543 2009-02-17 15:04:15Z cfasanando $
*/
@ -622,7 +622,7 @@ abstract class Question
{
$sql="SELECT max(position) FROM $TBL_QUESTIONS as question, $TBL_EXERCICE_QUESTION as test_question WHERE question.id=test_question.question_id AND test_question.exercice_id='".Database::escape_string($exerciseId)."'";
$result=api_sql_query($sql);
$current_position=mysql_result($result,0,0);
$current_position=Database::result($result,0,0);
$this -> updatePosition($current_position+1);
$position = $this -> position;

@ -1,4 +1,4 @@
<?php // $Id: database.lib.php 18504 2009-02-14 01:09:21Z yannoo $
<?php // $Id: database.lib.php 18543 2009-02-17 15:04:15Z cfasanando $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
@ -755,14 +755,16 @@ class Database
*/
function result($resource,$row,$field='')
{
if(!empty($field))
{
return mysql_result($resource,$row,$field);
}
else
{
return mysql_result($resource,$row);
}
if (mysql_num_rows($resource) > 0) {
if(!empty($field))
{
return mysql_result($resource,$row,$field);
}
else
{
return mysql_result($resource,$row);
}
}
}
/**
* Recovers the last ID of any insert query executed over this SQL connection

Loading…
Cancel
Save