![]() |
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:
|
what is $query ?? nothing is defined
you could use something like Code:
$myFile = "test.txt"; |
Thanks, you mean like this ? It doesnt worked :(
PHP Code:
|
There are two issues with the script are preventing it from working. The first is that you can not simply print an array as is, arrays reference to places in memory that hold your values. You have to go though each element of the array and write the value to the file. The other issue is that you were passing the array by value, since arrays reference memory opposed to directly holding a value, you need to pass that reference. The following works, since I didn't want to mess around with the SQL, I assigned the array by hand.
PHP Code:
|
| All times are GMT. The time now is 03:54 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0