Php 如何将数组值插入数据库

Php 如何将数组值插入数据库,php,Php,我想知道如何将'peter'、'paul'、'mary'置换值插入phpmyadmin数据库。 我的数据库(id,name1,name2,name3)id是自动递增的 <?php function pc_permute($items, $perms = array()) { if (empty($items)) { echo join(' ', $perms) . "<br />"; } else {

我想知道如何将'peter'、'paul'、'mary'置换值插入phpmyadmin数据库。 我的数据库(id,name1,name2,name3)id是自动递增的

    <?php
    function pc_permute($items, $perms = array()) {
        if (empty($items)) { 
            echo join(' ', $perms) . "<br />";
       } else {
            for ($i = count($items) - 1; $i >= 0; --$i) {
             $newitems = $items;
             $newperms = $perms;
             list($foo) = array_splice($newitems, $i, 1);
             array_unshift($newperms, $foo);
             pc_permute($newitems, $newperms);
         }
    }
}

$arr = array('peter', 'paul', 'mary');

pc_permute($arr);

?>


1 peter paul mary
2 peter mary paul
3 paul peter mary
4 paul mary peter
5 mary peter paul
6 mary paul peter

彼得·保罗·玛丽
彼得·玛丽·保罗
3保罗·彼得·玛丽
保罗·玛丽·彼得
5玛丽·彼得·保罗
6玛丽·保罗·彼得

phpMyAdmin是一个用PHP编写的MySQL管理工具,它本身不是一个数据库。您可能正在使用MySQL或MariaDB作为数据库。感谢您的帮助,我正在使用mysqlphpMyAdmin是一个用PHP编写的MySQL管理工具,它本身不是数据库。您可能正在使用MySQL或MariaDB作为数据库。谢谢您的帮助,我正在使用MySQL