FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Heredoc print to file? Use nowdoc.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Heredoc print to file? Use nowdoc. [message #172135 is a reply to message #172132] Mon, 31 January 2011 15:49 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <Csy1p.9030$Y8(dot)1426(at)newsfe06(dot)iad>,
"P E Schoen" <paul(at)pstech-inc(dot)com> wrote:

> "Jerry Stuckle" wrote in message
> news:ii6a9c$kmg$1(at)news(dot)eternal-september(dot)org...
>
>> Your biggest problem is you are still trying to equate PHP to Perl. It's a
>> HUGE mistake to do that (no matter what the language).
>> Trying to look for the differences will only confuse you.
>
> Well, I finally got everything working at least about as well as the
> equivalent Perl script, so now I can just continue to develop this project
> in PHP. I was confused about the {} operator and it seems that it is only
> needed within a string. Now I have something like this:
>
> $arr = array();
> $qres = $db->query($q);
> $line = 0;
> while ($row = $qres->fetcharray(SQLITE3_BOTH)) {
> for ($i = 0; $i < 9; $i++) {
> $arr[$line][$i] = $row[$i];
> }

Hmmm, you're collecting one row at a time and putting it in a 2D array.
Seems to me that if you do fetchAll instead of fetcharray then you get
*given* a 2D array and you don't even have to declare it. I would have
thought that to be more efficient.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Unable to connect to database server!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 21:18:37 GMT 2024

Total time taken to generate the page: 0.05765 seconds