/    Sign up×
Community /Pin to ProfileBookmark

Creating a line feed while writing to a .txt file

Hi
Could somebody pls. help me?

I am trying to creat a line feed after writing a line of data (comming from a MySql db) into a text file.

How do I get it to start that new line for my next data?

Please help.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@esmApr 22.2008 — [code=php]$line="the info for this line.n";[/code]

works for me.


.
Copy linkTweet thisAlerts:
@gogelpotauthorApr 22.2008 — I have tryed that but does not seem to work. Maby I am just ?

What I do have in my code is this:
[CODE]
$Client_id = mysql_result($result,$x,'id_lgn');
$FName = mysql_result($result,$x,'FName');
$LName = mysql_result($result,$x,'LName');
$EMail = mysql_result($result,$x,'Email');
$Type = mysql_result($result,$x,'Type');
$Status = mysql_result($result,$x,'Status');
$psswrd = mysql_result($result,$x,'psswrd');
$Contact = mysql_result($result,$x,'Contnum');
$Job = mysql_result($result,$x,'Job');
$Postal = mysql_result($result,$x,'Postal');

$Content = '"'.$Client_id.'",'.'"'.$FName.'",'.'"'.$LName.'",'.'"'.$EMail.'",'.'"'.$Type.'",'.'"'.$Status.'",'.'"'.$psswrd.'",'.'"'.$Contact.'",'.'"'.$Job.'",'.'"'.$Postal.'n"';
$file=fopen("report.txt",'a');
fwrite($file, $Content);
fclose($file);

[/CODE]


What is the reason why it does not work?
Copy linkTweet thisAlerts:
@esmApr 22.2008 — I have tryed that but does not seem to work. Maby I am just ?

What is the reason why it does not work?[/QUOTE]


Does it write anything at all...?

While everybody has their own style and reason for doing it, why not try:
[code=php]$Content= "$Client_id,$FName,$LName,$EMail,$Type,$Status,$psswrd,$Contact,$Job,$Postaln";
[/code]


I didn't test anything. :eek: Too lazy. ?



.
Copy linkTweet thisAlerts:
@gogelpotauthorApr 22.2008 — Thanks that helped.
Copy linkTweet thisAlerts:
@jasonahouleApr 22.2008 — If "n" doesn't work then try "rn".
×

Success!

Help @gogelpot spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...