本文整理汇总了PHP中PMA_buildSqlQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_buildSqlQuery函数的具体用法?PHP PMA_buildSqlQuery怎么用?PHP PMA_buildSqlQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_buildSqlQuery函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: implode
$unsaved_values[$rownumber] = $multi_edit_columns;
}
if (!$insert_fail && count($query_values) > 0) {
if ($is_insert) {
$value_sets[] = implode(', ', $query_values);
} else {
// build update query
$query[] = 'UPDATE ' . PMA_Util::backquote($GLOBALS['table']) . ' SET ' . implode(', ', $query_values) . ' WHERE ' . $where_clause . ($_REQUEST['clause_is_unique'] ? '' : ' LIMIT 1');
}
}
}
// end foreach ($loop_array as $where_clause)
unset($multi_edit_columns_name, $multi_edit_columns_prev, $multi_edit_funcs, $multi_edit_columns_type, $multi_edit_columns_null, $func_no_param, $multi_edit_auto_increment, $current_value_as_an_array, $key, $current_value, $loop_array, $where_clause, $using_key, $multi_edit_columns_null_prev, $insert_fail);
// Builds the sql query
if ($is_insert && count($value_sets) > 0) {
$query = PMA_buildSqlQuery($is_insertignore, $query_fields, $value_sets);
} elseif (empty($query) && !isset($_REQUEST['preview_sql']) && !$row_skipped) {
// No change -> move back to the calling script
//
// Note: logic passes here for inline edit
$message = PMA_Message::success(__('No change'));
$active_page = $goto_include;
include '' . PMA_securePath($goto_include);
exit;
}
unset($multi_edit_columns, $is_insertignore);
// If there is a request for SQL previewing.
if (isset($_REQUEST['preview_sql'])) {
PMA_previewSQL($query);
}
/**
示例2: testBuildSqlQuery
/**
* Test for PMA_buildSqlQuery
*
* @return void
*/
public function testBuildSqlQuery()
{
$GLOBALS['db'] = 'db';
$GLOBALS['table'] = 'table';
$query_fields = array('a', 'b');
$value_sets = array(1, 2);
$this->assertEquals(array('INSERT IGNORE INTO `db`.`table` (a, b) VALUES (1), (2)'), PMA_buildSqlQuery(true, $query_fields, $value_sets));
$this->assertEquals(array('INSERT INTO `db`.`table` (a, b) VALUES (1), (2)'), PMA_buildSqlQuery(false, $query_fields, $value_sets));
}