Minggu, 06 Oktober 2013

PHP Indonesia - Facebook: [Tanya Text File] Saya punya script PHP seperti d...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Refresh your vocabulary.

Learn a new word everyday by subscribing to Word of the Day. A great tool if you're studying for the GRE, GMAT or LSAT, or simply want to enhance your lexicon.
From our sponsors
[Tanya Text File] Saya punya script PHP seperti d...
Oct 7th 2013, 04:37, by Idle Track

Idle Track 4:37am Oct 7
[Tanya Text File]

Saya punya script PHP seperti di bawah ini :

//------------------------------------------------------------------------------------
$result = mysqli_query($connect, $query) or die("Query fail: " . mysqli_error());
while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) {
$data =$row['Tanggal'].'|'.$row['Cabang'].'|'.$row['Tarif'].'|'.$row['Denda'].'|'.$row['Angsuran'].'|';
$mydata = $data."\n";
$my_file = $akutansi.'_'.$tglAwal.'.txt';
$handle = fopen($my_file, 'a') or die('Cannot open file: '.$my_file);
fwrite($handle, $mydata);
}

fclose($handle);

//------------------------------------------------------------------------------------

Pertanyaannya :
Kenapa hasilnya pada saat saya buka di notepad berantakan, tidak sesuai dengan yang diinginkan, padahal sya ingin membuat satu baris satu record, dan ketika ada record kedua maka letaknya di baris kedua, begitu seterusnya...

Apakah ada solusi dari permasalah tersebut...

Khigawa Khaganiciyo 4:39am Oct 7
buka di Notepad++

Idle Track 4:40am Oct 7
Kalau pake notepad bagaimana ???

Ricky Orlando Napitupulu 4:40am Oct 7
coba buka di editor yang lebih mapan
kayak notepad pp
ato sublime

Khigawa Khaganiciyo 4:40am Oct 7
ga tau

Idle Track 4:41am Oct 7
Kalau di editor yang lain sih oke, tapi kalau mau di notepad bagaimana ????

Een Pahlefi 4:42am Oct 7
jiahh,, :v

Abu Unaisah Setianto 4:47am Oct 7
buat file di gedit trus buka di notepad juga berantakan om
coba di wordpad, kemungkinan hasilnya lebih baik

Azhar Madia 4:52am Oct 7
$mydata = $data."\r\n";

Idle Track 4:52am Oct 7
Iya, berarti notepad tidak bisa yah agar hasilnya tidak berantakan ????

Idle Track 4:52am Oct 7
Azhar Madia : Saya coba pak, (Y)

Idle Track 4:55am Oct 7
Terima kasih pak, dengan menambahkan huruf 'r' hasilnya sesuai dengan harapan,

Thread ini SUDAH TERSELESAIKAN

Azhar Madia 5:04am Oct 7
sekedar pejelasan saja, kalau besok2 mau googling: /r itu carriage return (enter), lengkapnya: http://id1.php.net/manual/en/language.types.string.php#language.types.string.syntax.double

Idle Track 5:06am Oct 7
Iya pak, saya kurang teliti dalam menelusuri materinya, ternyata dokumentasinya juga lengkap di web phpnya, (Y)

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar