TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 02-01-2010, 09:02 PM   #1 (permalink)
The Acquainted
 
Join Date: Feb 2008
Posts: 107
Thanks: 3
CΛSTΞX is on a distinguished road
Plugin/Addon Write Mysql results to a text file

Hello mates, I need help about writing mysql results to a text file. I stuck in this code, it only write "array" to a text file.

PHP Code:
$myFile "test.txt";
$fh fopen($myFile'w') or die("can't open file");

function 
data_dump$query ) {
    
$results mysql_query$query );

    
$data = array();

    while ( 
$row = @mysql_fetch_assoc$results ) )
        
$data[] = $row;

    return 
$data;
}

$stringData data_dump$query )."\n";

fwrite($fh$stringData);
fclose($fh); 
__________________
Downloadic
infolizer
Send a message via MSN to CΛSTΞX
CΛSTΞX is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php/html form to echo text file contents Hustle Absolute Beginners 2 03-10-2009 07:14 AM
Read Text File in Reverse buildakicker General 9 11-26-2008 06:43 PM
Writing to XML file buildakicker General 8 02-06-2008 08:17 PM
Outputting MySQL Results Andrew Advanced PHP Programming 5 01-13-2008 04:59 PM
Database export to text file... d4v1d Absolute Beginners 5 01-09-2008 04:30 PM


All times are GMT. The time now is 09:11 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design