从数组中提取值并将其复制到表中

时间:2019-01-23 14:21:06

标签: php mysql arrays

从数组中提取值并将其复制到表中

我需要从多个表中输入值,然后将它们复制到另一个表中。一些值在数组中,另一些在单个值中。

$sqlus = ExecuteRows("SELECT `Cell`, `fName`, `lName`, `DateNotify` FROM `view8`");

array (size=4)
  0 => 
    array (size=8)
      0 => string '4477885544' (length=10)
      'Cell' => string '4477885544' (length=10)
      1 => string 'Penelope' (length=8)
      'fName' => string 'Penelope' (length=8)
      2 => string 'Cruz' (length=4)
      'lName' => string 'Cruz' (length=4)
      3 => null
      'DateNotify' => null
  1 => 
    array (size=8)
      0 => string '1144778855' (length=10)
      'Cell' => string '1144778855' (length=10)
      1 => string 'Mando' (length=5)
      'fName' => string 'Mando' (length=5)
      2 => string 'Lino' (length=4)
      'lName' => string 'Lino' (length=4)
      3 => null
      'DateNotify' => null
  2 => 
    array (size=8)
      0 => string '1145566223' (length=10)
      'Cell' => string '1145566223' (length=10)
      1 => string 'Franco' (length=6)
      'fName' => string 'Franco' (length=6)
      2 => string 'Mascarpone' (length=10)
      'lName' => string 'Mascarpone' (length=10)
      3 => null
      'DateNotify' => null

exctract it in to multiple rows

$sqlno = ExecuteScalar("SELECT `NotifySms` FROM `notify`");

and conbine all values in to a new table

Execute("INSERT INTO myTable ('".$sqlno."', array[cell], array[fname], ...)

0 个答案:

没有答案