Re: php + postgresql
От
Ivan Sergio Borgonovo
Тема
Re: php + postgresql
Дата
Msg-id
20080724174047.42b8b6e0@dawn.webthatworks.it
Ответ на
Re: php + postgresql (David Spadea)
Список
Дерево обсуждения
php + postgresql admin <mick@mjhall.org>
Re: php + postgresql "Leif B. Kristensen" <leif@solumslekt.org>
Re: php + postgresql Ivan Sergio Borgonovo <mail@webthatworks.it>
Re: php + postgresql admin <mick@mjhall.org>
Re: php + postgresql Chris <dmagick@gmail.com>
Re: php + postgresql Bill Moran <wmoran@collaborativefusion.com>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql admin <mick@mjhall.org>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql "Joshua D. Drake" <jd@commandprompt.com>
Re: php + postgresql "Bill Wordsworth" <bill.wordsworth@gmail.com>
Re: php + postgresql "Joshua D. Drake" <jd@commandprompt.com>
Re: php + postgresql "Jonathan Bond-Caron" <jbondc@openmv.com>
Re: php + postgresql "Joshua D. Drake" <jd@commandprompt.com>
Re: php + postgresql Andrew Sullivan <ajs@commandprompt.com>
Re: php + postgresql "Jonathan Bond-Caron" <jbondc@openmv.com>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql Christophe <xof@thebuild.com>
Re: php + postgresql "Leif B. Kristensen" <leif@solumslekt.org>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql "Bill Wordsworth" <bill.wordsworth@gmail.com>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql "Joshua D. Drake" <jd@commandprompt.com>
Re: php + postgresql "Scott Marlowe" <scott.marlowe@gmail.com>
Re: php + postgresql "Scott Marlowe" <scott.marlowe@gmail.com>
Re: php + postgresql admin <mick@mjhall.org>
Re: php + postgresql "Joshua D. Drake" <jd@commandprompt.com>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql "Scott Marlowe" <scott.marlowe@gmail.com>
Re: php + postgresql Ivan Sergio Borgonovo <mail@webthatworks.it>
Re: php + postgresql Aarni Ruuhimäki <aarni@kymi.com>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql Aarni Ruuhimäki <aarni@kymi.com>
Re: php + postgresql Tino Wildenhain <tino@wildenhain.de>
Re: php + postgresql adam_pgsql <adam_pgsql@witneyweb.org>
Re: php + postgresql Craig Ringer <craig@postnewspapers.com.au>
Re: php + postgresql Raymond O'Donnell <rod@iol.ie>
Re: php + postgresql Raymond O'Donnell <rod@iol.ie>
Re: php + postgresql Richard Huxton <dev@archonet.com>
Re: php + postgresql Chris <dmagick@gmail.com>
Re: php + postgresql admin <mick@mjhall.org>
Re: php + postgresql "David Spadea" <david.spadea@gmail.com>
Re: php + postgresql Ivan Sergio Borgonovo <mail@webthatworks.it>
On Thu, 24 Jul 2008 11:13:52 -0400
"David Spadea" wrote:
> Mick,
>
> As I haven't seen anyone else say it, I just wanted to throw this
> in.
>
> I'm not a PHP programmer, so I'm not very sure of PHP's scoping
> rules, but this looks to me like a variable scoping problem. If
> the first time you've used $content is inside of the while(), it's
> probably going out of scope before your echo. Try this:
ivan@dawn:~$ php -a
Interactive mode enabled
# Initialize $content before going into the loop.
> # This declares it outside the scope of the while()
>
> $content=''';
mistype
> # Now do your loop
>
> while ($row = pg_fetch_array($query)) {
> $content = $row[0]
> }
>
> echo $content;
>
>
>
> Your loop is a little weird, too. You're not accumulating anything,
> you're just saving the previous value. When you exit the loop,
> $content will only contain the value from the final row. If that's
for debugging I suggested:
$content .= $row[0]." # ";
So he could see if any row even if all $row[0] contained '' or null.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
В списке pgsql-general по дате отправления