mysqli
无效
这是示例代码。
$connection = mysqli_connect("localhost", "root", "", "test") or die(mysqli_error());
function update_ins($connection){
$sql1 = "SELECT insID AS id, insWfl AS W FROM inszeitg_hjb13 WHERE insObjArtBig LIKE 'G'";
$obj1 = mysqli_query($connection, $sql1)or die(mysqli_error());
print_r($obj1);
$_data = fetch_data($obj1);
$q = "";
foreach($_data as $value){
$q .= "UPDATE inszeitg_hjb13 SET insGfl = '$value[W]' WHERE insID = $value[id] ; ";
}
if(mysqli_multi_query($connection, $q)){
echo "Table Updated";
}else{
die(mysqli_error("Error Occured:"));
}
}
答案 0 :(得分:2)
您可以使用以下示例检查文件/文件夹是否存在:
if(folder_exists("./new_folder")){
//code
}
if(file_exists("./new_folder/file.php")){
//code
}
答案 1 :(得分:1)
您可以使用这些功能:
1。is_file($path)
$ path is:
file - >返回true
文件夹 - >返回错误
2。is_dir($path)
$ path is:
file - >返回错误
文件夹 - >返回true
3。file_exists($path)
$ path is:
file - >返回true
文件夹 - >返回true