Re: [PHP-DB] Problem with query

2013-06-25 Thread Karl DeSaulniers
Im going to play devils advocate here and say, why is it the one who's helping 
that needs to be polite and respectful? Isn't it also the newbies 
responsibility to respect and be polite to those taking time out of their day 
to help them and not be so stubborn as to not take the advice given which has 
been the example given here by Ethan? Ethan has been given great advice and 
should be taking that advice and looking things up and learning, not asking 
"Newbie confused, please explain?". It seems to me that the "Help" is being 
taken advantage of here and used as a crutch to get the work done that Ethan 
has taken upon himself even thought he knows he knows very little about 
programming in PHP. And that is PHP not PhD. But all that aside as you can see, 
the same people who Ethan has somewhat ignored their advice are still going 
against their better judgement to go out of their way to help.. again. Just how 
much help should be given before you realize the horse is just not drinking the 
water? I am all for Ethan getting help from the list and I don't want to 
chastise, but come on, someone with a PhD should know better and should know 
even better then most on how to listen and learn. Hence the PhD. You don't get 
one of those by doing what Ethan is doing. If he did that to his professors, he 
would have failed. Just saying.

Best,
Karl


On Jun 25, 2013, at 1:32 AM, OJFR wrote:

> Yeah, Jim, please explain what u mean by "Per the manual, associative arrays
> using string indices should always use ' ' around them.  They work (as
> mentioned in the manual) but are wrong". As long as I remember  I could use
> associative arrays in that way (ex. $_SESSION['Cust_Num']). There's another
> way to do that using string indices? Why do you say it's wrong? It's
> obsolete?
> 
> I would like to make a call to all the members of this mailing list:
> knowledge is a wonderful gift so, why we don't share it politely and
> efficiency. Jim, I will take you as an example. You start saying " Against
> my better judgement, here I go again". If it's against your better judgment
> please don't go anywhere, your conscience is a good adviser. After that you
> talked a little about standards and some manual. If you are not happy to
> help people who make some mistakes regarding to programming standards, you
> should inform them where they can find the glorious manual and what is the
> correct syntax to do what people need to do. This is a better way to show to
> others what you know in a humble way but I suppose that wasn't what you were
> trying to do. I consider this list is to HELP others and share what we know.
> "Never break the silence if it's not to make it better".
> 
> Ethan, I will check your problem and I'll write you back as soon as I can
> 'cause right now I don't have anything installed in my computer. I'll try to
> do it tomorrow, ok? Be nice and stay well!!!
> 
> Osain.
> 
> -Mensaje original-
> De: Ethan Rosenberg, PhD [mailto:erosenb...@hygeiabiomedical.com] 
> Enviado el: domingo, junio 23, 2013 4:38 PM
> Para: php-db@lists.php.net; Jim Giner
> Asunto: [PHP-DB] Re: Problem with query
> 
> On 6/23/2013 2:31 PM, Ethan Rosenberg, PhD wrote:
>> Dear List -
>> 
>> There is an error in my query, and I cannot find it.
>> 
>> This fails:
>> 
>> $_SESSION['Cust_Num'] = $_REQUEST['cnum']; $_SESSION['CustNum'] = 
>> $_REQUEST['cnum'];
>> 
>> echo "session"; //this has the proper values print_r($_SESSION);
>> 
>> $sql10 = "select Balance, Payments, Charges, Date from Charges where 
>> Cust_Num = $_SESSION[Cust_Num] order by Date"; echo $sql10; //echos 
>> the correct query
>> $result10 = mysqli_query($cxn, $sql10); var_dump($result1); // this 
>> returns NULL
> 
> Against my better judgement, here I go again.
> 
> Is this the "actual" code you executed, or is it once again a typeover?
> 
> Your 1st error is in these two lines:
>> $result10 = mysqli_query($cxn, $sql10); var_dump($result1); // this 
>> returns NULL
> 
> Yes your dump returns null.  And always will.
> 
> 
> Any further errors might be related to your non-standard syntax for the
> session variable.  Per the manual, associative arrays using string indices
> should always use ' ' around them.  They work (as mentioned in the manual)
> but are wrong.
> ===
> Jim -
> 
> 
> Is this the "actual" code you executed, or is it once again a typeover?
> 
>   The actual code
> 
> Any further errors might be related to your non-standard syntax for the
> session variable.  Per the manual, associative arrays using string indices
> should always use ' ' around them.  They work (as mentioned in the manual)
> but are wrong.
> 
>   Newbie is confused.
> 
>   Please explain.
> 
> TIA
> 
> Ethan
> 
> --
> PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
> 
> 
> --
> 
> Este mensaje le ha llegado mediante el servicio de correo electronico que 
> ofrece Infomed para respaldar el cumplimiento de las mision

Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Jim Giner

On 6/25/2013 2:32 AM, OJFR wrote:

Yeah, Jim, please explain what u mean by "Per the manual, associative arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I could use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

If YOU had taken the time to check the manual as I DID, you would not 
have blown your top at me.  When I said 'per the manual', I meant it. It 
was not something I made up to taunt Ethan with - it was from the place 
all of us here quote on a regular basis.


Apology accepted.

And if you were a regular participant in this helpful forum, you would 
know of my attitude when dealing with Mr. Rosenberg, PhD.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Toby Hart Dyke


The original post is here:

http://news.php.net/php.db/48751

On 6/25/2013 1:02 PM, Michael Oki wrote:

I'm sorry I've not been following the last three responses. In a nutshell,
what "EXACTLY" does the poster of this issue want?


On 25 June 2013 11:06, Toby Hart Dyke  wrote:


What Jim means is here in the manual:

http://www.php.net/manual/en/**language.types.array.php#**
language.types.array.donts

In a nutshell:

Always use quotes around a string literal array index. For example,
/$foo['bar']/ is correct, while /$foo[bar]/ is not.

The reason is that without the quotes, you are generating an undefined
constant (bar) rather than using a string index ('bar'). It works, but
could have side effects in the future, so it's bad form to do it.

As for general politeness, you seem to be unaware of recent history in
this (an associated) groups. The OP has often committed the ultimate sine.
Not posting slightly wild code (we've all been/are there!) He doesn't seem
to listen or learn too well. Many posters (including Jim) have offered a
lot of of extremely good (and detailed) advice which seems to be rarely
taken...

   Toby



On 6/25/2013 7:32 AM, OJFR wrote:


Yeah, Jim, please explain what u mean by "Per the manual, associative
arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I could
use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's
another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

I would like to make a call to all the members of this mailing list:
knowledge is a wonderful gift so, why we don't share it politely and
efficiency. Jim, I will take you as an example. You start saying " Against
my better judgement, here I go again".






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Jim Giner

On 6/25/2013 6:06 AM, Toby Hart Dyke wrote:


What Jim means is here in the manual:

http://www.php.net/manual/en/language.types.array.php#language.types.array.donts


In a nutshell:

Always use quotes around a string literal array index. For example,
/$foo['bar']/ is correct, while /$foo[bar]/ is not.

The reason is that without the quotes, you are generating an undefined
constant (bar) rather than using a string index ('bar'). It works, but
could have side effects in the future, so it's bad form to do it.

As for general politeness, you seem to be unaware of recent history in
this (an associated) groups. The OP has often committed the ultimate
sine. Not posting slightly wild code (we've all been/are there!) He
doesn't seem to listen or learn too well. Many posters (including Jim)
have offered a lot of of extremely good (and detailed) advice which
seems to be rarely taken...

   Toby


On 6/25/2013 7:32 AM, OJFR wrote:

Yeah, Jim, please explain what u mean by "Per the manual, associative
arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I
could use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's
another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

I would like to make a call to all the members of this mailing list:
knowledge is a wonderful gift so, why we don't share it politely and
efficiency. Jim, I will take you as an example. You start saying "
Against
my better judgement, here I go again".




My humble thanks for your timely support.  :)

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Michael Oki
I'm sorry I've not been following the last three responses. In a nutshell,
what "EXACTLY" does the poster of this issue want?


On 25 June 2013 11:06, Toby Hart Dyke  wrote:

>
> What Jim means is here in the manual:
>
> http://www.php.net/manual/en/**language.types.array.php#**
> language.types.array.donts
>
> In a nutshell:
>
> Always use quotes around a string literal array index. For example,
> /$foo['bar']/ is correct, while /$foo[bar]/ is not.
>
> The reason is that without the quotes, you are generating an undefined
> constant (bar) rather than using a string index ('bar'). It works, but
> could have side effects in the future, so it's bad form to do it.
>
> As for general politeness, you seem to be unaware of recent history in
> this (an associated) groups. The OP has often committed the ultimate sine.
> Not posting slightly wild code (we've all been/are there!) He doesn't seem
> to listen or learn too well. Many posters (including Jim) have offered a
> lot of of extremely good (and detailed) advice which seems to be rarely
> taken...
>
>   Toby
>
>
>
> On 6/25/2013 7:32 AM, OJFR wrote:
>
>> Yeah, Jim, please explain what u mean by "Per the manual, associative
>> arrays
>> using string indices should always use ' ' around them.  They work (as
>> mentioned in the manual) but are wrong". As long as I remember  I could
>> use
>> associative arrays in that way (ex. $_SESSION['Cust_Num']). There's
>> another
>> way to do that using string indices? Why do you say it's wrong? It's
>> obsolete?
>>
>> I would like to make a call to all the members of this mailing list:
>> knowledge is a wonderful gift so, why we don't share it politely and
>> efficiency. Jim, I will take you as an example. You start saying " Against
>> my better judgement, here I go again".
>>
>
>


Re: [PHP-DB] Re: Problem with query

2013-06-25 Thread Toby Hart Dyke


What Jim means is here in the manual:

http://www.php.net/manual/en/language.types.array.php#language.types.array.donts

In a nutshell:

Always use quotes around a string literal array index. For example, 
/$foo['bar']/ is correct, while /$foo[bar]/ is not.


The reason is that without the quotes, you are generating an undefined 
constant (bar) rather than using a string index ('bar'). It works, but 
could have side effects in the future, so it's bad form to do it.


As for general politeness, you seem to be unaware of recent history in 
this (an associated) groups. The OP has often committed the ultimate 
sine. Not posting slightly wild code (we've all been/are there!) He 
doesn't seem to listen or learn too well. Many posters (including Jim) 
have offered a lot of of extremely good (and detailed) advice which 
seems to be rarely taken...


  Toby


On 6/25/2013 7:32 AM, OJFR wrote:

Yeah, Jim, please explain what u mean by "Per the manual, associative arrays
using string indices should always use ' ' around them.  They work (as
mentioned in the manual) but are wrong". As long as I remember  I could use
associative arrays in that way (ex. $_SESSION['Cust_Num']). There's another
way to do that using string indices? Why do you say it's wrong? It's
obsolete?

I would like to make a call to all the members of this mailing list:
knowledge is a wonderful gift so, why we don't share it politely and
efficiency. Jim, I will take you as an example. You start saying " Against
my better judgement, here I go again".