Sir
I create a file and all date save in txt file. i need 2nd data show in next line or line break but line break doesn't work in txt Format. please help me.
[PHP]<?
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$sl=1;
$Cur_Trns_Dt = date('Y-m-d');
?>
<?
$br = "\n";
$spr = ";";
$sql = "SELECT * FROM `stu_info` WHERE age=25 ORDER BY id ASC";
$result=mysql_q uery($sql)or die(mysql_error ());
$i=1;
while($row=mysq l_fetch_array($ result))
{
$id=$row['id'];
$Name=$row['name'];
$Age=$row['age'];
$Address=$row['address'];
//WRITE DATA
fwrite($fh, $id);
fwrite($fh, $spr);
fwrite($fh, $Name);
fwrite($fh, $spr);
fwrite($fh, $Age);
fwrite($fh, $spr);
fwrite($fh, $Address);
fwrite($fh, $br);
$i++;
}
?>
<?
fclose($fh);
?>[/PHP]
Thanks Noorain
I create a file and all date save in txt file. i need 2nd data show in next line or line break but line break doesn't work in txt Format. please help me.
[PHP]<?
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$sl=1;
$Cur_Trns_Dt = date('Y-m-d');
?>
<?
$br = "\n";
$spr = ";";
$sql = "SELECT * FROM `stu_info` WHERE age=25 ORDER BY id ASC";
$result=mysql_q uery($sql)or die(mysql_error ());
$i=1;
while($row=mysq l_fetch_array($ result))
{
$id=$row['id'];
$Name=$row['name'];
$Age=$row['age'];
$Address=$row['address'];
//WRITE DATA
fwrite($fh, $id);
fwrite($fh, $spr);
fwrite($fh, $Name);
fwrite($fh, $spr);
fwrite($fh, $Age);
fwrite($fh, $spr);
fwrite($fh, $Address);
fwrite($fh, $br);
$i++;
}
?>
<?
fclose($fh);
?>[/PHP]
Thanks Noorain
Comment