php-general Digest 24 Feb 2008 22:00:56 -0000 Issue 5312

Topics (messages 269988 through 270014):

Re: temporary error
        269988 by: Robert Cummings
        269989 by: tedd
        269990 by: tedd
        270000 by: Zoltán Németh

Re: All Survey leading to PHP
        269991 by: tedd

Re: mysql_field_name
        269992 by: tedd

Re: Plant Extracts and Our Factory
        269993 by: tedd
        269997 by: Shawn McKenzie

Re: Question about PHP Licence and it's future!
        269994 by: tedd

Re: System errno in PHP
        269995 by: Michal Maras

Re: Session destruction problem
        269996 by: Shawn McKenzie

Re: Shopping Carts
        269998 by: Shawn McKenzie
        269999 by: Robert Cummings
        270005 by: Bastien Koert

Re: temprorary error
        270001 by: Mary Anderson
        270002 by: Robert Cummings
        270003 by: Zoltán Németh
        270010 by: tedd
        270013 by: Robert Cummings

PHPTriad and php error
        270004 by: hE
        270006 by: Bastien Koert
        270007 by: hE
        270009 by: Bastien Koert

mysql test and error
        270008 by: hE
        270011 by: Brady Mitchell
        270012 by: Nathan Rixham
        270014 by: hE

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Sun, 2008-02-24 at 03:34 -0500, Andrés Robinet wrote:
> > -----Original Message-----
> > From: Robert Cummings [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, February 24, 2008 2:34 AM
> > To: Andrés Robinet
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: [PHP] Re: temporary error
> > 
> > 
> > On Sat, 2008-02-23 at 20:11 -0500, Andrés Robinet wrote:
> > > > -----Original Message-----
> > > > From: Greg Donald [mailto:[EMAIL PROTECTED]
> > > > Sent: Saturday, February 23, 2008 1:33 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: [PHP] Re: temporary error
> > > >
> > > > On 2/23/08, tedd <[EMAIL PROTECTED]> wrote:
> > > > > I love the book written by Carl Sagan the "The Dragons of Eden" -- he
> > > > >  has an interesting perspective on the God thing and it contains more
> > > > >  substance than a cute quote.
> > > >
> > > > Well as long as we're quoting famous old fence-sitting agnostics, lets
> > > > not forget Sagan's best:
> > > >
> > > > 'If by "God" one means the set of physical laws that govern the
> > > > universe, then clearly there is such a God. This God is emotionally
> > > > unsatisfying... it does not make much sense to pray to the law of
> > > > gravity.'
> > > >
> > > >
> > > > --
> > > > Greg Donald
> > > > http://destiney.com/
> > >
> > > Why not? Many people believes in such a God, so he has a very high
> > probability
> > > of existence, and it has taken the worst part as nobody I know of is
> > currently
> > > praising and praying to him.
> > 
> > You sir have homework:
> > 
> >     http://en.wikipedia.org/wiki/Bandwagon_effect
> >     http://en.wikipedia.org/wiki/List_of_cognitive_biases
> >     http://en.wikipedia.org/wiki/Critical_Thinking
> > 

> LOL, I have to recognize that my previous email had some dirty tricks in it. 
> I was mostly being ironic. I'm actually more of an agnostic person (with some 
> atheism moments from time to time). So, let me clarify what I said and to 
> whom I said it:
> 
> *Many people believe in such a God, so he has a very high probability of 
> existence*:
> 
> To those who say that something exists because they believe in it. That can't 
> be true, since anybody can argue the opposite (something does not exist, 
> because they don't believe in it) and neither of them can be proved.
> As both statements can't be true, we can assume there's no deterministic way 
> in which existence can be derived from belief. So we can propose as an 
> alternate hypothesis that existence is a probabilistic variable, proportional 
> to the number of believers, ergo, the aforementioned God has pretty good 
> chance of existence.
> Furthermore, in order to simplify the problem we can compute the probability 
> of existence, in a weighted average fashion, using the metric *believer 
> contribution to the human race* (from now on called C), we get following 
> formula:
> 
> P(G) = SUM [ C(i)*X(i) ] / SUM [ C(i) ]
> 
> Were, P(G) is the *probability of existence of god G*, C(i) is the 
> aforementioned metric applied to person *i* and X is a binary variable, such 
> that:
> 
> X(i) = [*i* is a person: 1 if person *i* is a believer of god G, 0 otherwise]
> 
> We can even find joint probabilities for gods G1 and G2 and calculate all 
> sorts of statistic parameters. The only problem is determining C(i), that is, 
> a measure of the contribution of person *i* to the human race, but our team 
> has found a method for that. I can't get deeper into this, because I would be 
> in violation the NDA I have signed with NSA.
> Interesting though, is that we can find gods that have more probability of 
> existence than an electron in the first level of energy of an hydrogen atom 
> (and we don't have such a complicated formula! 
> http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation)
> So this is more of a scientific reality (still being researched) than a bias 
> in our brains. And we must believe in science, *EVERYONE DOES*, right? (lol)

This is still invalid argument. I'm not sure if it falls under "illusory
correlation", "proof by verbosity" or both. It makes no difference what
the math says since we know nothing about the probability and we cannot
ascertain any probability from any sample. The probability that God
exists doesn't change depending on the audience, just like the
probability of a fair dice doesn't change depending on the thrower (note
I said fair dice ;). To declare some probability means we have some
knowledge of God, but if we did then the whole issue would be moot. And
so the probability is unknown. For instance, the question is not the
same as trying to guess the probability of aliens existing in the
universe. For the universe we know the approximate size, and we know
that there are already creatures living in the universe (us). And so we
can try to guess a probability based on this knowledge. But for God...
we know nothing.

> *and it has taken the worst part as nobody I know of is currently
> praising and praying to him*
> 
> Just part of the (bogus) argument. I have not yet conducted a survey,
> but, why would you praise a God if he has no implications in your life
> (hey, perhaps that's how the *personal God* idea arose in human
> minds). And why would you pray to him, if he's not interested in your
> fate or life and has zero requirements to let you in his *private
> circle of trust*? (yes, I took that from *The Fockers* movie).
> 
> So, there are scientific studies to support my argument (call
> 0800-THE-NSA and ask for Rob if you don't believe me). And at least a
> rational assumption also (*and it has taken the worst part as
> nobody...*).
> What bias are you talking about?

There are lies, damn lies, and statistics. Polls and surveys merely
point out social trends. Nothing more. There are no scientific studies
that can give you the probability that God exists and any probabilty
based on social trends is bogus.

> PS. Please excuse me, I'll get a cup of coffee to improve synapses
> (lol). Btw, do you think that the fact that most of us use footers in
> emails has something to do with the Bandwagon Effect?

Maybe. Just because you're within the bandwagon effect doesn't mean you
chose based on the bandwagon. For footers it may just be a case of "Wow,
I never knew you could do that!" versus "OMTG I gotta have me a footer
cuz everyone else has one and I don't want to be left out!" :)

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
At 12:12 PM -0600 2/23/08, Greg Donald wrote:
On 2/23/08, tedd <[EMAIL PROTECTED]> wrote:
  For us to criticize each other for our beliefs would serve no purpose
  other than to exhibit intolerance. And, I think we can all agree that
  intolerance should not be tolerated.

I believe it was Thomas Jefferson who said, "Ridicule is the only
weapon which can be used against unintelligible propositions."

Greg:

While I like Thomas Jefferson, it doesn't mean that I agree with everything he said nor that he is right.

Besides, I don't think your proposition is unintelligible. :-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
At 12:32 PM -0600 2/23/08, Greg Donald wrote:
On 2/23/08, tedd <[EMAIL PROTECTED]> wrote:
 I love the book written by Carl Sagan the "The Dragons of Eden" -- he
  has an interesting perspective on the God thing and it contains more
  substance than a cute quote.

Well as long as we're quoting famous old fence-sitting agnostics, lets
not forget Sagan's best:

I wasn't quoting -- I was providing reference.

'If by "God" one means the set of physical laws that govern the
universe, then clearly there is such a God. This God is emotionally
unsatisfying... it does not make much sense to pray to the law of
gravity.'

Seems an obvious statement.

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
2008. 02. 22, péntek keltezéssel 14.49-kor Greg Donald ezt írta:
> On 2/22/08, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > So help me God
> 
> Speaking of imaginary things, check out this new site I built few weeks back:
> 
> http://rewriteproject.com/
> 
> I do believe I am the first person to ever "tag cloud" a bible  :)

hehe that site rocks :)

greets
Zoltán Németh

> 
> 
> -- 
> Greg Donald
> http://destiney.com/
> 

--- End Message ---
--- Begin Message ---
At 8:44 PM +0100 2/23/08, Per Jessen wrote:
tedd wrote:

 If a client hires me to do something, whatever code I write is his --
 that's simple enough.


Tedd - the world is not limited to PHP contractors.  Think about people
writing products that they sell.

Been there, done that for a long time -- decades in fact. I wrote a lot of Mac and Apple applications.

I finally arrived at a place where I realize that the time it takes to protect what you've done cost you more than it would if you just moved on to the next project.

Also, it's usually not the code that matter as such, it's the algorithm
or the method.

Expose the method and usually someone can duplicate and improve it.

So that goes to my first point -- why spend effort trying to stop someone who can't be stopped?

Now, that doesn't mean that you can't patent your idea -- and that's the best protection I know.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
At 8:16 PM -0300 2/23/08, Emiliano Boragina wrote:
I want to see all fields name of the DB and only in one TR… how can I do
that (in code please)?

$result = mysql_query($query) or die(report($query,__LINE__ ,__FILE__));
$columns = mysql_num_fields($result);
for($i = 0; $i <= $columns; $i++)
        {
        echo("<th> mysql_field_name($result, $i)</th>");
        }

This works for me -- however, it could be improved.

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
At 4:02 AM +0800 2/24/08, [EMAIL PROTECTED] wrote:
Mr. Dong

I think that says it all.

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
> Greetings!
> 
> Are you looking for the best quality natural plant extract products at great 
> prices and with speedy and reliable delivery? If so, you are having a good 
> day because ShanShan Biotechnology is ready to serve you.
> 
> We own advanced equipment and technology, utilize high-quality materials and 
> solvent, and employ a highly-skilled staff operating under strict management. 
> After capital investments amounting to nearly US$80 million, our company has 
> the largest extraction base in Asia. We introduced two sets of automatic 
> supercritical carbon dioxide extract equipment (1500L×3 and 3500L×3 ) from 
> UHDE company, Krupp Group (Germany). We have one set of refining equipment 
> from Messo Company (also Germany). And three sets of advanced dynamic 
> countercurrent extraction equipment using membrane filtration and 
> concentration. Our factory covers an area of 1,520,000 square meters. 
> Our factory got the certificate of ISO9001, ISO14001, HACCP and Kosher, 
> Meanwhile we have advanced analytical apparatus such as HPLC, GC and UV etc. 
> 
> We are already producing the high-ratio water-soluble Cinnamon Bark Extract 
> with de-cinnamic aldehyde and de-coumarin. We also produce the other plant 
> extracts, ingredients and plants oils by Supercritical Fluid extraction with 
> natural carbon dioxide. HPLC, TLC, GC chromatograms and factory image are 
> available on request.
> 
> Write to us for more info.
> 
> Best wishes,
> 
> Mr. Dong
> ShanShan Biotechnology co., ltd. Wuhu. China ShanShan Group.
> T:+86 553 5719388
> F:+86 553 5719963
> E-mail: [EMAIL PROTECTED]
>         [EMAIL PROTECTED]
> Web: www.naturalcn.com
> Add: Gangwan Road, Economic & Tech zone, Wuhu,China, 241007

Mr. Dong, your site is in ASP, why are you posting here?

-Shawn

--- End Message ---
--- Begin Message ---
Rob (Other Rob that is actually called Andrés)

Yeah, that confused me too. Especially when I saw you arguing with yourself.

Also, the phrase:

"Rob (Other Rob that is actually called Andrés)"

would read better as:

"Rob (Other Rob who is actually called Andrés)"

Why don't you use the name Andrés ? That's much better than "Rob" anyway. ;-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Hi

 Thank you for answer, but I do not understand.
 How can I use this class Errno after unsuccessful fopen?
 I want to get the number, for example 13 if there is not enough permissions
to open file.
It is not problem for me that script will be no portable, it is
only for AIX.

By

On 22/02/2008, Ravi Menon <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I also ran into the same issue with file and socket apis, and for now, I
> just
> hack it like ( for linux 2.6 systems ):
>
> class Errno
> {
> const EINTR        =  4;
> const EIO          =  5;
> const EINVAL       =  22;
> const ENODATA      =  61;
> const EBADMSG      =  74;
> const EOPNOTSUPP   =  95;
> const ECONNRESET   =  104;
> const ENOTCONN     =  107;
> const ETIMEDOUT    =  110;
> const EALREADY     =  114;
> const EINPROGRESS  =  115;
>
> // useful static methods that use posix_strerror()
> // and socket_strerror() to return strings for logging purposes...
> .
> .
>
> }
>
> Clearly this is not portable, but I am betting that usually on the
> same kernel releases, they
> don't usually change these numbers around.
>
> Having PHP expose these useful constants in a portable manner would be
> a big plus.
>
> Thanks,
> Ravi
>
>
> On Thu, Feb 21, 2008 at 9:04 AM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> > On Wed, February 20, 2008 2:56 am, Michal Maras wrote:
> >  > I have read http://php.net/fopen from top to bottom, but I could not
> >  > find
> >  > how to get  system error number.
> >  > With set_error_handler I can get string for example
> >  >
> >  > fopen(hmc_configuration.cfg)
> >  > [function.fopen<
> http://ds63450.mspr.detemobil.de/%7Emmaras/HMC/function.fopen>]:
> >  > failed to open stream: Permission denied
> >  >
> >  > but I need integer number not string, because string error messages
> >  > depends
> >  > on locale setting.
> >  >  Of course, I can test some conditions before fopen, but it is not
> >  > enough
> >  > for me.
> >
> >  Put in a Feature Request to expose the error number from the OS, I
> >  guess...
> >
> >  http://bugs.php.net/
> >
> >  It *seems* like it ought to be reasonable enough to this naive user.
> >
> >
> >  --
> >  Some people have a "gift" link here.
> >  Know what I want?
> >  I want you to buy a CD from some indie artist.
> >  http://cdbaby.com/from/lynch
> >  Yeah, I get a buck. So?
> >
> >  --
> >
> >
> > PHP General Mailing List (http://www.php.net/)
> >  To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

--- End Message ---
--- Begin Message ---
Adil Drissi wrote:
> Hi,
> 
> I made an error i was using
> unset($_SESSION["sessioname"]) instead of
> unset($_SESSION). I'm sorry, but anyway, now i want to
> give another detail. All the time i was testing with
> opera. After testing in firefox and ie there is no
> problem with the code i posted.
> 

Yes, that was the suggestion six days ago ;-)

-Shawn

--- End Message ---
--- Begin Message ---
> questions and help out people who try and stumble...

I'm less likely to help someone who "tries to stumble".

-Shawn

--- End Message ---
--- Begin Message ---
On Sun, 2008-02-24 at 09:43 -0600, Shawn McKenzie wrote:
> > questions and help out people who try and stumble...
> 
> I'm less likely to help someone who "tries to stumble".

In case you weren't be sarcastic... the intent of the above line was
probably the following:

   ...questions and help out people who try... and stumble...

Or more clearly:

   ...questions and help out people who try but stumble...

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
> To: [EMAIL PROTECTED]> Date: Sun, 24 Feb 2008 09:43:20 -0600> From: [EMAIL 
> PROTECTED]> Subject: Re: [PHP] Shopping Carts> > > questions and help out 
> people who try and stumble...> > I'm less likely to help someone who "tries 
> to stumble".> > -Shawn> > -- > PHP General Mailing List 
> (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php> 
 
I usually stumble after too much beer ;-)
 
bastien
_________________________________________________________________


--- End Message ---
--- Begin Message ---
Hey guys,
    Isn't this thread a bit OT?
Anyway, as areligious person I have to say that I really do not like to hear religions trashed and smeared the way you are doing. And just for the record, we Quakers do not believe God tells us to kill people and we have no priests.

Mary Anderson

--- End Message ---
--- Begin Message ---
On Sun, 2008-02-24 at 09:59 -0800, Mary Anderson wrote:
> Hey guys,
>      Isn't this thread a bit OT?

Probably.

>      Anyway, as  areligious person I have to say that I really do not 
> like to hear religions trashed and smeared the way you are doing.  And 
> just for the record, we Quakers do not believe God tells us to kill 
> people and we have no priests.

I dunno... as a religious person I would think you would think it was on
topic. After all according to your philosophy, God begat creation,
creation begat humans, humans begat Rasmus, Rasmus begat PHP. Who's
trashing religion anyways? I don't think I heard any trashing... or do
you mean the biblical parody site? Seems that's humour, not trashing.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
2008. 02. 24, vasárnap keltezéssel 09.59-kor Mary Anderson ezt írta:
> Hey guys,
>      Isn't this thread a bit OT?

well, for a php list sure it is... but not the first one, and it seems
to me that many members of the list are interested in it...

>      Anyway, as  areligious person I have to say that I really do not 
> like to hear religions trashed and smeared the way you are doing.  And 
> just for the record, we Quakers do not believe God tells us to kill 
> people and we have no priests.

actually I think there was no trashing and smearing here, only some
decent talking about religion and some humor (the 'rewrite the bible'
site)

greets
Zoltán Németh

> 
> Mary Anderson
> 

--- End Message ---
--- Begin Message ---
At 7:38 PM +0100 2/24/08, Zoltán Németh wrote:
2008. 02. 24, vasárnap keltezéssel 09.59-kor Mary Anderson ezt írta:
 Hey guys,
      Isn't this thread a bit OT?

well, for a php list sure it is... but not the first one, and it seems
to me that many members of the list are interested in it...

      Anyway, as  areligious person I have to say that I really do not
 like to hear religions trashed and smeared the way you are doing.  And
 just for the record, we Quakers do not believe God tells us to kill
 people and we have no priests.

actually I think there was no trashing and smearing here, only some
decent talking about religion and some humor (the 'rewrite the bible'
site)


I'm sure you'll get an argument over the "no trashing and smearing here" claim.

But, in your defense, you probably don't realize the disrespect shown, or that's perceived by others, regarding beliefs.

It's a touchy subject and usually not one to discuss with a wide range of different beliefs, some of which hold other's beliefs in low esteem -- as does the 'rewrite the bible' site. Incidentally, which started the religious portion of this thread.

I think we've about beat this to death, so we can let it go and get our collective thoughts back to more worldly endeavors. Besides, I'm starting to get emails from the OT police, which I tend to agree with.

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Sun, 2008-02-24 at 15:55 -0500, tedd wrote:
> At 7:38 PM +0100 2/24/08, Zoltán Németh wrote:
> >2008. 02. 24, vasárnap keltezéssel 09.59-kor Mary Anderson ezt írta:
> >>  Hey guys,
> >>       Isn't this thread a bit OT?
> >
> >well, for a php list sure it is... but not the first one, and it seems
> >to me that many members of the list are interested in it...
> >
> >>       Anyway, as  areligious person I have to say that I really do not
> >>  like to hear religions trashed and smeared the way you are doing.  And
> >>  just for the record, we Quakers do not believe God tells us to kill
> >>  people and we have no priests.
> >
> >actually I think there was no trashing and smearing here, only some
> >decent talking about religion and some humor (the 'rewrite the bible'
> >site)
> 
> 
> I'm sure you'll get an argument over the "no trashing and smearing here" 
> claim.
> 
> But, in your defense, you probably don't realize 
> the disrespect shown, or that's perceived by 
> others, regarding beliefs.
> 
> It's a touchy subject and usually not one to 
> discuss with a wide range of different beliefs, 
> some of which hold other's beliefs in low esteem 
> -- as does the 'rewrite the bible' site. 
> Incidentally, which started the religious portion 
> of this thread.
> 
> I think we've about beat this to death

Sooooooooo.... let's resurrect it!! *ducks and runs away cackling*

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
hi to all,
I set up phptriad on my computer running windows xp. When I tried to test php with the following program I got an error "Parse error: parse error, expecting `','' or `';'' in C:\apache\htdocs\mytest.php on line 10"

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php

echo “This is a PHP line”;
phpinfo();
?>
</body></html>

what is the reason?

p.s. phpinfo.php which comes with the installation executes correctly.

--- End Message ---
--- Begin Message ---
> To: [EMAIL PROTECTED]> Date: Sun, 24 Feb 2008 20:53:03 +0200> From: [EMAIL 
> PROTECTED]> Subject: [PHP] PHPTriad and php error> > hi to all,> I set up 
> phptriad on my computer running windows xp. When I tried to > test php with 
> the following program I got an error "Parse error: parse > error, expecting 
> `','' or `';'' in C:\apache\htdocs\mytest.php on line 10"> > <html>> <head>> 
> <title>PHP Test</title>> </head>> <body>> <p>This is an HTML line> <p>> 
> <?php> > echo “This is a PHP line”;> phpinfo();> ?>> </body></html>> > what 
> is the reason?> > p.s. phpinfo.php which comes with the installation executes 
> correctly.> > -- > PHP General Mailing List (http://www.php.net/)> To 
> unsubscribe, visit: http://www.php.net/unsub.php> 
 
Use proper quotes (single or double as long as you are consistent) to wrap the 
text. That is what the error is telling you.
 
Note that when using quotes, double quotes will eveluate php variables 
correctly, while single quotes treat them as text.
 
bastien
_________________________________________________________________


--- End Message ---
--- Begin Message --- thanks for the help. I am a C/C++ programmer and decide to learn php and mysql to develop web pages. is it the correct place to ask questions similar to this? or is there any other group suitable for this?
--- End Message ---
--- Begin Message ---
This is a good place, other include various forums and the manual
 
bastien> To: [EMAIL PROTECTED]> Date: Sun, 24 Feb 2008 21:21:01 +0200> From: 
[EMAIL PROTECTED]> Subject: Re: [PHP] PHPTriad and php error> > thanks for the 
help. I am a C/C++ programmer and decide to learn php and > mysql to develop 
web pages. is it the correct place to ask questions > similar to this? or is 
there any other group suitable for this?> > -- > PHP General Mailing List 
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php> 
_________________________________________________________________


--- End Message ---
--- Begin Message ---
hi,
I found an e-book in the net about php and mysql and with its sample program I am trying to test whether I have mysql working correctly or not. the following program gives error message. why?

<html>
<head><title>Test MySQL</title></head>
<body>
<!-- mysql_up.php -->
<?php3
$host=”localhost”;
$user=”root”;
$password=””;
mysql_connect($host,$user,$password);
$sql=”show status”;
$result = mysql_query($sql);
if ($result == 0)
echo “<b>Error “ . mysql_errno() . “: “
. mysql_error() . “</b>”;
else
{
?>
<!-- Table that displays the results -->
<table border=”1”>
<tr><td><b>Variable_name</b></td><td><b>Value</b>
</td></tr>
<?php3
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo “<TR>”;
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo “<TD>” . $row_array[$j] . “</td>”;
}
echo “</tr>”;
}
?>
</table>
<?php3 } ?>
</body></html>

--- End Message ---
--- Begin Message ---

On Feb 24, 2008, at 1135AM, hE wrote:

hi,
I found an e-book in the net about php and mysql and with its sample program I am trying to test whether I have mysql working correctly or not. the following program gives error message. why?

What exactly does the error message say? We can help troubleshoot errors much better with error messages. :)

<html>
<head><title>Test MySQL</title></head>
<body>
<!-- mysql_up.php -->
<?php3

Change <?php3 to <?php - everywhere in your code.

By the fact that it's using <?php3 I'm guessing this is a very old tutorial. I'd strongly suggest using a more recent tutorial. There have been lots of changes since PHP3 and there's no reason to start with such an old version.

Here are some places to start:

http://devzone.zend.com/article/627-PHP-101-PHP-For-the-Absolute-Beginner
http://hudzilla.org/phpwiki/index.php?title=Main_Page

I also strongly suggest taking some time to go through the manual. Browse through the different sections and get an idea for what is available. Obviously I'm not suggesting you memorize the manual, but I've found it very helpful to occasionally browse through a section or two in the manual, I always seem to find functions I wasn't aware of before. This really helps in deciding the best way to solve a problem.

if ($result == 0)
echo “<b>Error “ . mysql_errno() . “: “
. mysql_error() . “</b>”;

Is this all on one line in your code? If not it needs to be inside curly braces, though this could be just a case of long lines be broken up by your email software. For consistency and readability, especially when starting with a new language, I tend to always use curly braces - even if not needed.

if ($result == 0)
{
        echo '<b>Error ' . mysql_errno() . ': '. mysql_error() . '</b>';
}

else
{
?>
<!-- Table that displays the results -->
<table border=”1”>
<tr><td><b>Variable_name</b></td><td><b>Value</b>
</td></tr>
<?php3
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo “<TR>”;
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo “<TD>” . $row_array[$j] . “</td>”;
}
echo “</tr>”;
}
?>

One last suggestion, indent your code. For example:

else
{
        ?>
        <!-- Table that displays the results -->
        <table border=”1”>
        <tr><td><b>Variable_name</b></td><td><b>Value</b></td></tr>
        <?php
        for ($i = 0; $i < mysql_num_rows($result); $i++)
        {
                echo '<TR>';
                $row_array = mysql_fetch_row($result);
                for ($j = 0; $j < mysql_num_fields($result); $j++)
                {
                        echo '<TD>'. $row_array[$j] . '</td>';
                }
                echo '</tr>';
        }
        ?>
        </table>
        <?php
}
?>

While it's not necessary, I find it much easier to read and troubleshoot code when indented.

Brady

--- End Message ---
--- Begin Message ---
hE wrote:
hi,
I found an e-book in the net about php and mysql and with its sample program I am trying to test whether I have mysql working correctly or not. the following program gives error message. why?

<html>
<head><title>Test MySQL</title></head>
<body>
<!-- mysql_up.php -->
<?php3
$host=”localhost”;
$user=”root”;
$password=””;
mysql_connect($host,$user,$password);
$sql=”show status”;
$result = mysql_query($sql);
if ($result == 0)
echo “<b>Error “ . mysql_errno() . “: “
. mysql_error() . “</b>”;
else
{
?>
<!-- Table that displays the results -->
<table border=”1”>
<tr><td><b>Variable_name</b></td><td><b>Value</b>
</td></tr>
<?php3
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo “<TR>”;
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo “<TD>” . $row_array[$j] . “</td>”;
}
echo “</tr>”;
}
?>
</table>
<?php3 } ?>
</body></html>

because the ebook is ancient and <?php3 isn't used anymore [i'd sure hope]

try..

<html>
<head><title>Test MySQL</title></head>
<body>
<!-- mysql_up.php -->
<?php
$host=”localhost”;
$user=”root”;
$password=””;
mysql_connect($host,$user,$password) or die(mysql_errno() . “: “. mysql_error());
$sql=”show status”;
$result = mysql_query($sql);
if ($result == 0)
echo “<b>Error “ . mysql_errno() . “: “
. mysql_error() . “</b>”;
else
{
?>
<!-- Table that displays the results -->
<table border=”1”>
<tr><td><b>Variable_name</b></td><td><b>Value</b>
</td></tr>
<?php
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo “<TR>”;
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo “<TD>” . $row_array[$j] . “</td>”;
}
echo “</tr>”;
}
?>
</table>
</body></html>

--- End Message ---
--- Begin Message ---
The following program gave the error:

 "Parse error: parse error in C:\apache\htdocs\mysqltest.php on line 10"


<html>
<head><title>Test MySQL</title></head>
<body>
<!-- mysql_up.php -->
<?php
$host=”localhost”;
$user=”root”;
$password=””;
mysql_connect($host,$user,$password);
$sql=”show status”;
$result = mysql_query($sql);
if ($result == 0)
echo '<b>Error ' . mysql_errno() . ': '. mysql_error() . '</b>';
else
{
?>
<!-- Table that displays the results -->
<table border=”1”>
<tr><td><b>Variable_name</b></td><td><b>Value</b>
</td></tr>
<?php
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo '<TR>';
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo '<TD>'. $row_array[$j] . '</td>';
}
echo '</tr>';
}
?>
</table>
</body></html>

what is the reason?

--- End Message ---

Reply via email to