[Typo3-dev] CWT Frontend Edit ->undefined function: dodatabaseupdatequery() - Another error ?

Jacob Lindhardsen web at jacoblindhardsen.dk
Sat Jul 17 22:03:39 CEST 2004


I get this error when I try to use the function createBlankRecord (see
below):

1. Problem might be that I am not defining my parent_class - because the
documentation is not very good .....
2. It could also be related to register_globals...(mine are off) ?
3. Other wise I dont know - have debugged the query doDatabseUpdateQuery to
ensure that values are put in ...

Please have a look.

Fatal error: Call to undefined function: dodatabaseupdatequery() in
/var/www/html/typo3conf/ext/cwt_feedit/pi1/class.tx_cwtfeedit_pi1.php on
line 1077

I can edit records succesfully - and the only change is making the
$record_uid through the createBlankRecord function.

Thanks for anything,
Jacob from Denmark

The functions look like this:

/* createBlankRecord($cruser_id, $table)
 *
 *  This function creates a blank record in the target table. This function
can be called
 *  without instatiating this class.
 *
 *  @param  $cruser_id The fe user uid, of the user, that wants to create
the record
 *  @param  $table The table, where the record will be created.
 *  @return $uid The uid of the record we have just created.
 */
 function createBlankRecord($cruser_id, $table) {
  //Get globals
  //$cruser_id = $this->cruser_id;
  //$table = $this->table;
  //Get the timestamp

  $time = time();
  //Do the query
  $res = $this->doDatabaseUpdateQuery("INSERT INTO ".$table." (crdate,
cruser_id, tstamp) VALUES (".$time.", ".$cruser_id.", ".$time.")");
  //Get the uid of the record, that we have just created
  $uid = $this->doDatabaseQuery("SELECT uid FROM ".$table." WHERE crdate =
".$time." AND cruser_id = ".$cruser_id);
  return $uid[0]["uid"];
 }

 /* doDatabaseQuery($query)
 *
 *  This function runs queries on the typo3 database and returns the
 *  result set in an associative array e.g. $return[0]['myAttribute'].
 *  Please notice, that this function is only suitable for 'SELECT'
 *  queries.
 *
 *  @param $query Database query, which will be executed. e.g. 'SELECT *
FROM myTable'
 *  @return array Associative array with query results
 */
 function doDatabaseQuery($query)
 {
  // Do the query
  $res = mysql(TYPO3_db, $query);
  // Preparing result set
  $rows = array();
  while ($row = mysql_fetch_assoc($res)) {
   $rows[] = $row;
  }
  // Debugging
  if ($this -> debug) {
   echo "Query: $query<br>";
   print_r($rows);
   echo "<br>";
  }
  // Return the array
  return $rows;
 }

 /* doDatabaseUpdateQuery($query)
 *
 *  [Description]
 *  @param $query Database query, which will be executed. e.g. 'UPDATE
myTable SET myAttribute=myValue WHERE...'
 *  @return null
 */
 function doDatabaseUpdateQuery($query)    {
        // Do the query
                 $res = mysql(TYPO3_db, $query);
                 // Debugging
                    if ($this -> debug) {
                    echo "Query: $query<br>";
                    echo "<br>";
                  }
                  // Return the array
                  return null;
    }
}






More information about the TYPO3-dev mailing list