ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
inc.meta_data_converter.php
Go to the documentation of this file.
1
<?
php
2
3
function
ilMDConvert
($table,$fields,$key)
4
{
5
global
$ilDB
;
6
7
$where =
"WHERE "
;
8
$where .= implode(
" LIKE '%\%' ESCAPE '�' OR "
,
ilUtil::quoteArray
($fields));
9
$where .=
" LIKE '%\\%' ESCAPE '�'"
;
10
11
$query
=
"SELECT * FROM "
.$table.
" "
.
12
$where;
13
14
$res
= $ilDB->query(
$query
);
15
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
))
16
{
17
$query
=
"UPDATE $table "
;
18
19
$counter
= 0;
20
foreach
($fields as $field)
21
{
22
if
(
$counter
++)
23
$query
.=
", "
;
24
else
25
$query
.=
"SET "
;
26
27
$query
.= ($field .
" = "
.$ilDB->quote(stripslashes(
$row
->$field)).
" "
);
28
}
29
$query
.= (
" WHERE "
.$key.
" = "
.$ilDB->quote(
$row
->$key));
30
31
// Perform the query
32
$ilDB->query(
$query
);
33
}
34
}
ilMDConvert
ilMDConvert($table, $fields, $key)
Definition:
inc.meta_data_converter.php:3
$res
$res
Definition:
examplelayouts.sql.php:25
$query
$query
Definition:
examplelayouts.sql.php:24
$counter
$counter
Definition:
config-scanner.php:59
ilUtil\quoteArray
static quoteArray($a_array)
Quotes all members of an array for usage in DB query statement.
Definition:
class.ilUtil.php:4731
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
Services
Migration
DBUpdate_635
inc.meta_data_converter.php
Generated on Fri Jan 17 2025 19:01:15 for ILIAS by
1.8.13 (using
Doxyfile
)