Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Improvement in OrionDB_DB_MySQL.php

#2

Currently the runquery function only allows a query to be run on the database if a proper tablename is provided. This is not always useful, especially when running queries that take information from many tables. As the tablename is only used to format an error message, it is better to adjust the error message depending on what information is in the $tablename parameter. The body of the function then becomes this:

if($query == "") return false;
if($tablename == ""){
 $tablename = $this->get_tablename_in_proper_case($this->cleansql($tablename));
   $errormessage = "Error while retrieving a collection from table " . $tablename;        
}
else {
   $errormessage = "Error while executing an multi-table query.";
}

$result = mysql_query($query) or fataldberror($query, $errormessage . ": " . mysql_error());
$numrows = mysql_num_rows($result);
if($numrows > 0){
  $returnarray = array();
  for($index=0;$index<$numrows;$index++){
    $returnarray[] =  mysql_fetch_array($result);
  }
  return $returnarray;
} 
else return false;

Reported by Maurits Lamers · March 10th, 2010 @ 11:20 AM

State: resolved
Milestone: none
Assigned to: Maurits Lamers Maurits Lamers

Activity

  1. Maurits Lamers
    Maurits Lamers
    • State changed from open to resolved

    April 5th, 2010 @ 04:26 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.