1
I have a code that executes a simple query like this
select * from tabela where coluna1 = 'valor';
then I have a variable that brings a txt file
$filename = "C:/Programfile/arquivo.txt";
and then I make that condition below
if (file_exists($filename)) {
rename($filename,$filename.".old");
}
$file = fopen($filename,"a+");
after that I do the query while
while ($row = mysql_fetch_array($sql))
{
$content = $row[0];
$content .= "\r";
$content .= "\n";
$result = fputs($file,$content);
//break;
}
fclose($file);
the result of the query goes into the text file using vbs only I am with a problem that when the query has no record the text file becomes empty and I am not able to execute the script when the query does not return record someone can help me
I tried to do it and it didn’t work
if(filesize($filename)){
exit;
}
or in place of the already put Exit return false e die()
and it didn’t work.
I already solved the problem
– josé wilker