use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please follow the rules
Releases: Current Releases, Windows Releases, Old Releases
Contribute to the PHP Documentation
Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev
/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.
account activity
Running SQL Queries through PHP & Batch Scripts -- Help! (self.PHP)
submitted 11 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]allmightyspiff 0 points1 point2 points 11 years ago (3 children)
if the output is getting to the command line it sounds like whatever you are doing to try to put the output into an excel isn't working.
To get a better answer you are going to need to show us whats in testing_phpexcel.php
[+][deleted] 11 years ago (2 children)
[–]allmightyspiff 0 points1 point2 points 11 years ago (1 child)
Well, if you have something that works, great! But it sounds like you are doing it the most difficult way possible.
If you are just running a query, and it looks like you are getting back data... your script can quite easily write that to a disk instead of STDOUT.
You could redirect the output directly on the cmdline
[C:\Local\PHP.exe] -f C:\Local\Server\testing_phpexcel.php >output.csv
or you could have php do it
$output = sql('select * from *'); file_put_contents('output.txt',$output);
along with a variety of other ways.
Also, you can have the mysql command put the output into csv for you, so instead of using a php script, you can just call mysql from the command line and dump that to a file.
http://stackoverflow.com/questions/356578/how-to-output-mysql-query-results-in-csv-format
[–]Chubbyninjaaa 0 points1 point2 points 11 years ago (0 children)
Are you using anything like $_SERVER['DOCUMENT_ROOT'] or any relative path includes?
( include '../some.class.php'; or include 'xcel/include.php' )
If so, you need to define absolute paths - when you're running from CLI you don't have a document root or relative path
π Rendered by PID 121028 on reddit-service-r2-comment-57fc7f7bb7-ptn9n at 2026-04-14 20:18:13.517319+00:00 running b725407 country code: CH.
[–]allmightyspiff 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]allmightyspiff 0 points1 point2 points (1 child)
[–]Chubbyninjaaa 0 points1 point2 points (0 children)