我正在使用一个收集表单数据的复杂MySQL数据库表.我在下面的一个名为test的示例表中简化了布局:
|FormID|FieldName| FieldValue |
| 1 | city | Houston |
| 1 | country | USA |
| 2 | city | New York |
| 2 | country |United States|
| 3 | property| Bellagio |
| 3 | price | 120 |
| 4 | city | New York |
| 4 |zip code | 12345 |
| 5 | city | Houston |
| 5 | country | US |
Run Code Online (Sandbox Code Playgroud)
通过phpmyadmin我需要全球更新一些表格,具体我要更新所有fieldValue方法 …
我使用以下脚本正确显示所选目录及其子目录中的所有文件.有谁知道如何修改此代码只回显目录/子目录中的最新文件?
function ListFiles($dir) {
if($dh = opendir($dir)) {
$files = Array();
$inner_files = Array();
while($file = readdir($dh)) {
if($file != "." && $file != ".." && $file[0] != '.') {
if(is_dir($dir . "/" . $file)) {
$inner_files = ListFiles($dir . "/" . $file);
if(is_array($inner_files)) $files = array_merge($files, $inner_files);
} else {
array_push($files, $dir . "/" . $file);
}
}
}
closedir($dh);
return $files;
}
}
foreach (ListFiles('media/com_form2content/documents/c30') as $key=>$file){
echo "{aridoc engine=\"google\" width=\"750\" height=\"900\"}" . $file ."{/aridoc}";
}